Commit graph

27517 commits

Author SHA1 Message Date
Miss Islington (bot)
cbb4d4a642
Fix a typo in the message from make_ssl_certs. (GH-30152) (GH-30161)
The file is utils.py not util.py.

Automerge-Triggered-By: GH:gpshead
(cherry picked from commit 69ef1b5998)

Co-authored-by: Yilei "Dolee" Yang <yileiyang9@gmail.com>
2021-12-16 21:51:11 -08:00
Miss Islington (bot)
09d7319bfe
bpo-46105: Honor spec when generating requirement specs with urls and extras. (GH-30151)
(cherry picked from commit 109d966021)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2021-12-16 13:19:14 -08:00
Miss Islington (bot)
8e4c96295b
bpo-26952: [argparse] clearer error when formatting an empty mutually… (GH-30099) (GH-30114)
(cherry picked from commit 86de99588d)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-12-15 12:20:04 +00:00
Miss Islington (bot)
908fd691f9
[3.10] bpo-46063: Add 'delay=True' to file handler initialization. (GH-30103) (GH-30104) 2021-12-14 17:27:00 +00:00
Miss Islington (bot)
f84e2f6c0a
[3.10] bpo-46063: Improve algorithm for computing which rolled-over log file… (GH-30093) (GH-30094)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2021-12-14 01:17:56 +00:00
Serhiy Storchaka
e55deaabd8
[3.10] bpo-27718: Fix help for the signal module (GH-30063) (GH-30080)
Functions signal(), getsignal(), pthread_sigmask(), sigpending(),
sigwait() and valid_signals() were omitted.

If __all__ is not defined all non-builtin functions should have
correct __module__.
(cherry picked from commit e08c0d8eec)
2021-12-13 12:14:51 +02:00
Miss Islington (bot)
94483f1e3c
bpo-46054: Fix parsing error when parsing non-utf8 characters in source files (GH-30068) (GH-30069)
(cherry picked from commit 4325a766f5)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-12-12 16:52:49 +00:00
Miss Islington (bot)
438817fdd5
bpo-46042: Improve SyntaxError locations in the symbol table (GH-30059) (GH-30064)
(cherry picked from commit 59435eea08)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-12-12 01:24:12 +00:00
Miss Islington (bot)
e1e3f648ad
bpo-45822: Minor cleanups to the test_Py_CompileString test (GH-29750) (GH-29758)
(cherry picked from commit abfc794bbf)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-12-11 01:02:56 +01:00
Miss Islington (bot)
934a24c641
bpo-46025: Fix a crash in the atexit module for auto-unregistering functions (GH-30002) (GH-30005)
(cherry picked from commit f0d290d25c)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-12-09 15:16:09 +00:00
Mark Shannon
99c72326d2
[3.10] bpo-46009: Do not exhaust generator when send() method raises (GH-29986). (GH-29988)
* [3.10] bpo-46009: Do not exhaust generator when send() method raises (GH-29986).
(cherry picked from commit 69806b9516)

Co-authored-by: Mark Shannon <mark@hotpy.org>

* Rename variable after cherry-pick.

* Add NULL check.
2021-12-08 14:46:32 +00:00
Pablo Galindo Salgado
c521412003
[3.10] bpo-46004: Fix error location for loops with invalid targets (GH-29959). (GH-29961)
(cherry picked from commit 1c7a1c3be0)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-12-07 15:23:33 +00:00
Miss Islington (bot)
cb68c0a3a4
bpo-45664: Fix resolve_bases() and new_class() for GenericAlias instance as a base (GH-29298)
(cherry picked from commit 2b318ce1c9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-12-05 13:26:37 -08:00
Miss Islington (bot)
abceb66c7e
bpo-45663: Fix is_dataclass() for dataclasses which are subclasses of types.GenericAlias (GH-29294)
(cherry picked from commit 446be16686)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-12-05 13:04:29 -08:00
Miss Islington (bot)
f1dd5ed1f3
bpo-45662: Fix the repr of InitVar with a type alias to the built-in class (GH-29291)
For example, InitVar[list[int]].
(cherry picked from commit 1fd4de5bdd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-12-05 13:02:47 -08:00
Miss Islington (bot)
beb834292d
bpo-27946: Fix possible crash in ElementTree.Element (GH-29915)
Getting an attribute via attrib.get() simultaneously with replacing
the attrib dict can lead to access to deallocated dict.
(cherry picked from commit d15cdb2f32)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-12-05 11:04:52 -08:00
Irit Katriel
4d2cc3ed46
bpo-45614: Fix traceback display for exceptions with invalid module name (GH-29726) (GH-29826)
(cherry picked from commit 4dfae6f38e)
2021-11-29 10:07:24 +00:00
Miss Islington (bot)
305236e03a
bpo-37658: Actually return result in race condition (GH-29202)
(cherry picked from commit 934a826237)

Co-authored-by: Sam Bull <aa6bs0@sambull.org>
2021-11-29 00:37:34 -08:00
Miss Islington (bot)
2c398a5acf
[3.10] bpo-19460: Add test for MIMENonMultipart (GH-29817) (GH-29818)
Co-authored-by: 180909 <wjh180909@gmail.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2021-11-28 12:57:10 +02:00
Pablo Galindo Salgado
c72311d917
[3.10] bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if inside parentheses. (GH-29767)
Backport of GH-29757

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2021-11-25 01:01:40 +00:00
Miss Islington (bot)
56b5cd52ab
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only (GH-29691) (GH-29708)
(cherry picked from commit 4fad314246)

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2021-11-22 09:05:54 -06:00
Miss Islington (bot)
10343bd983
bpo-44649: Fix dataclasses(slots=True) with a field with a default, but init=False (GH-29692)
Special handling is needed, because for non-slots dataclasses the instance attributes are not set: reading from a field just references the class's attribute of the same name, which contains the default value. But this doesn't work for classes using __slots__: they don't read the class's attribute. So in that case (and that case only), initialize the instance attribute. Handle this for both normal defaults, and for fields using default_factory.
(cherry picked from commit d3062f672c)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2021-11-22 05:47:41 -08:00
Miss Islington (bot)
9841ac2da5
bpo-45852: Fix the Counter/iter test for statistics.mode() (GH-29667) (GH-29671)
Suggested by Stefan Pochmann.
(cherry picked from commit 48744db70e)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2021-11-20 18:27:44 -06:00
Miss Islington (bot)
cf8c8788c9
Added kw_only parameter to make_dataclasses. (GH-29679)
(cherry picked from commit f7638dd0f9)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2021-11-20 15:46:56 -08:00
Pablo Galindo Salgado
511ee1c0fa
[3.10] bpo-45727: Make the syntax error for missing comma more consistent (GH-29427) (GH-29647)
(cherry picked from commit 546cefcda7)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-20 17:39:17 +00:00
Łukasz Langa
904af3de2b
[3.10] bpo-45848: Allow the parser to get error lines from encoded files (GH-29646) (GH-29661)
(cherry picked from commit fdcc46d955)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-20 16:34:56 +01:00
Miss Islington (bot)
5cf05c71d1
bpo-45835: Fix race condition in test_queue (GH-29601) (GH-29612)
Some of the tests in test_queue had a race condition in which a
non-sentinel value could be enqueued after the final sentinel value
leading to not all the inputs being processed (and test failures).

This changes feed() to enqueue a sentinel once the inputs are exhausted,
which guarantees that the final queued object is a sentinel. This
requires the number of feeder threads to match the number of consumer
threads, but that's already the case in the relevant tests.
(cherry picked from commit df3e53d86b)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2021-11-18 17:05:40 +01:00
Łukasz Langa
8eabe60108
[3.10] bpo-45826: Fix a crash in suggestions.c by checking for traceback is None (GH-29590) (GH-29602)
(cherry picked from commit 5d90c467c0)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2021-11-18 01:28:04 +01:00
Pablo Galindo Salgado
e3aa9fd77b
[3.10] bpo-45822: Respect PEP 263's coding cookies in the parser even if flags are not provided (GH-29582) (GH-29586)
(cherry picked from commit da20d7401d)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-18 00:17:18 +01:00
Miss Islington (bot)
1079b3e3cb
bpo-42540: reallocation of id_mutex should not force default allocator (GH-29564)
Unlike the other locks reinitialized by _PyRuntimeState_ReInitThreads,
the "interpreters.main->id_mutex" is not freed by _PyRuntimeState_Fini
and should not force the default raw allocator.
(cherry picked from commit 736684b1bb)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2021-11-17 13:16:01 -08:00
Pablo Galindo Salgado
5618c81e13
[3.10] bpo-45716: Improve the error message when using True/False/None as keywords in a call (GH-29413). (GH-29428)
(cherry picked from commit e2d65630f3)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-16 22:31:16 +00:00
Miss Islington (bot)
bf26a6da7a
bpo-45738: Fix computation of error location for invalid continuation (GH-29550)
characters in the parser
(cherry picked from commit 25835c518a)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-11-13 17:30:03 -08:00
Miss Islington (bot)
e4c5a5eaba
bpo-45235: Revert an argparse bugfix that caused a regression (GH-29525) (GH-29530) 2021-11-12 12:44:55 -06:00
Brandt Bucher
a89bbde83f
[3.10] bpo-45773: Stop "optimizing" certain jump patterns (GH-29526) 2021-11-11 13:52:43 -08:00
Irit Katriel
c5bfb88eb6
[3.10] bpo-45757: Fix bug where dis produced an incorrect oparg on EXTENDED_ARG before a no-arg opcode (GH-29480) (GH-29506) 2021-11-09 22:05:30 +00:00
Miss Islington (bot)
6603f6b5bd
bpo-45644: Make json.tool read infile before writing to outfile (GH-29273) (GH-29445)
so that

$ python -m json.tool foo.json foo.json

doesn't result in an empty foo.json.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 815dad42d5)

Co-authored-by: Chris Wesseling <chris.wesseling@protonmail.com>
2021-11-06 19:01:17 +01:00
Miss Islington (bot)
bcb236c19e
bpo-45678: Add more `singledispatchmethod` tests (GH-29412) (GH-29424)
In order to fix a bug in the 3.9 branch in GH-29394, more tests were added to
``test_functools.py`` to ensure that ``singledispatchmethod`` still correctly
wrapped a target method, even if the target method had already been wrapped by
 multiple other decorators. This PR brings the new tests into the 3.11 and 3.10
branches as well.
(cherry picked from commit 32f55d1a5d)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-11-05 16:27:22 +01:00
Miss Islington (bot)
1f3ae5c1ca
bpo-30570: Fix segfault on buildbots caused by stack overflow from recursion in tests (GH-29258)
* Don't stackoveflow on debug builds

* Also catch the pickletester case
(cherry picked from commit d56375a0dd)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2021-11-04 13:45:05 -07:00
Miss Islington (bot)
f1918385cc
bpo-45678: Add `functools.singledispatchmethod` tests (GH-29328) (GH-29390)
(cherry picked from commit 5a14929a6e)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-11-03 17:45:20 +01:00
Łukasz Langa
fd6b70d6b7
[3.10] bpo-45578: add tests for dis.distb (GH-29332) (GH-29385)
(cherry picked from commit e346f19681)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-11-03 16:53:36 +01:00
Miss Islington (bot)
cfdd7d26a7
bpo-45406: make inspect.getmodule() return None when getabsfile() raises FileNotFoundError (GH-28824)
(cherry picked from commit a459a81530)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-11-02 15:23:43 -07:00
Miss Islington (bot)
3997f3ce8a
bpo-45679: Fix caching of multi-value typing.Literal (GH-29334)
Literal[True, 2] is no longer equal to Literal[1, 2].
(cherry picked from commit 634984d7db)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-31 01:43:40 -07:00
Serhiy Storchaka
6b867022d9
[3.10] bpo-45502: Fix test_shelve (GH-29003) (GH-29305)
Run test_shelve with all underlying dbm implementations and pickle protocols.
Also make test_shelve discoverable.
(cherry picked from commit b781cc3bfc)
2021-10-29 12:40:22 +03:00
Miss Islington (bot)
7203ecd332
bpo-45577: test all pickle protocols in test_zoneinfo (GH-29167) (GH-29296)
(cherry picked from commit 66e6b3dcd3)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-10-29 00:00:49 +02:00
Miss Islington (bot)
eccb753ae6
bpo-45624: make test_graphlib not depend on the iteration order of sets (GH-29233) (GH-29293)
the current test depended on integer sets being iterated on in a certain
fixed order. That order is different on PyPy (insertion based) and could
change in CPython in the future in theory. Make the test robust against
a different iteration order by sorting.
(cherry picked from commit 7401694807)

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2021-10-28 23:15:01 +02:00
Miss Islington (bot)
1f45cc0dfa
bpo-44904: Fix classmethod property bug in doctest module (GH-28838)
The doctest module raised an error if a docstring contained an example that
attempted to access a classmethod property. (Stacking '@classmethod' on top of
`@property` has been supported since Python 3.9; see
https://docs.python.org/3/howto/descriptor.htmlGH-class-methods.)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit b1302abcc8)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-10-28 01:09:41 -07:00
Miss Islington (bot)
ce7a6afb79
bpo-45438: format of inspect.Signature with generic builtins (GH-29212)
Use types.GenericAlias in inspect.formatannotation to correctly add
type arguments of builtin types to the string representation of
Signatures.

Co-authored-by: Martin Rückl <martin.rueckl@codecentric.de>
(cherry picked from commit d02ffd1b5c)

Co-authored-by: Martin Rueckl <enigma@nbubu.de>
2021-10-27 14:57:07 -07:00
Miss Islington (bot)
36971fd1f4
bpo-45566: test_frozen_pickle checks all pickle protocols (GH-29150)
Refs https://github.com/python/cpython/pull/29147

Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit 07236d562e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-10-24 06:29:37 -07:00
Miss Islington (bot)
f812fef2f8
bpo-30570: Use Py_EnterRecursiveCall() in issubclass() (GH-29048)
* Use Py_EnterRecursiveCall() in issubclass()

Reviewed-by: Gregory P. Smith <greg@krypto.org> [Google]
(cherry picked from commit 423fa1c181)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2021-10-22 14:46:56 -07:00
Miss Islington (bot)
8f6aa48cb2
bpo-43592: Raise RLIMIT_NOFILE in test.libregrtest (GH-29127)
Raise RLIMIT_NOFILE in test.libregrtest.

On macOS the default is often too low for our testsuite to succeed.

Co-authored by reviewer: Victor Stinner
(cherry picked from commit 843b890334)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2021-10-21 21:47:07 -07:00