Commit Graph

47399 Commits

Author SHA1 Message Date
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
Hugo van Kemenade 9501e8d3a3
bpo-45837: Note tiltangle is not deprecated, it's really settiltangle (GH-29629) 2021-11-19 19:55:40 +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
Anthony Sottile 7c99e434a9
ensure deprecation warning from assertDictContainsSubset points at actual test code (#26497) 2021-11-15 21:11:02 -06:00
Miss Islington (bot) 94dad5e41e
bpo-45677: Reword first section of `sqlite3` docs (GH-29326) (GH-29566)
* bpo-45677: Avoid addressing the reader as 'you' in sqlite3 docs

* Adjust wording

* Adjust wording again

* Typo

* Update Doc/library/sqlite3.rst

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>

* Address review: adjust wording

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Lib/sqlite3/__init__.py

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Lib/sqlite3/__init__.py

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Apply Alex' suggestion, and apply 80 char limit to PR

* Minor adjustment

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit 6c5a312fb6)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-11-15 15:31:38 -08:00
Miss Islington (bot) 55d24edaad
bpo-45752: Remove "array" from list of things that cannot be copied in `copy` module docstring (GH-29555)
Automerge-Triggered-By: GH:asvetlov
(cherry picked from commit c2c4fdf5ea)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-11-14 05:18:31 -08: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) ed55426acd
[bpo-45765] Fix distribution discovery on empty path. (GH-29487) (GH-29510)
(cherry picked from commit 6ec0dec7b7)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2021-11-13 15:08:28 -05: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) 8fdf6c64d3
bpo-27313: Use non-deprecated methods for tracing (GH-29425) (GH-29450)
(cherry picked from commit cc1cbcbb2d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-11-06 20:23:00 +01: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) 099a94fba3
bpo-45160: Fix refleak in test_ttk_guionly introduced in GH-28291 (GH-29416) (GH-29421)
(cherry picked from commit 54d1e3f72e)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-05 11:00:18 +01:00
Miss Islington (bot) 363ecb36da
bpo-27313: Fix ttk_guionly tests failing on Framework builds on macOS (GH-29411) (GH-29422)
(cherry picked from commit e52f9bee80)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-05 10:59:34 +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
Miss Islington (bot) 191a93905a
[3.10] bpo-45628: Check all parts of the suffix for an extension match. (GH-29310) (GH-29314) 2021-10-29 16:25:31 +01: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) 823b3e39ae
bpo-45612: Add sqlite3 module docstring (GH-29224) (GH-29288)
(cherry picked from commit 4dd1e84789)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-10-28 22:24:52 +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
Miss Islington (bot) 6b75ad5fd4
bpo-45557: Fix underscore_numbers in pprint.pprint(). (GH-29129)
(cherry picked from commit 087f089e5e)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2021-10-21 14:16:59 -07:00
Miss Islington (bot) 98f157de12
bpo-45160: Ttk optionmenu only set variable once (GH-28291) (GH-29131)
(cherry picked from commit add46f8476)

Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
2021-10-21 23:02:20 +02:00
Ethan Furman 2a9ab75af3
bpo-44559: [Enum] restore fixes lost in 3.9 reversion (GH-29114)
- fix exception leaks
- re-add deprecation warnings
2021-10-20 19:48:37 -07:00
Miss Islington (bot) 64e83c711e
bpo-45192: Fix a bug that infers the type of an os.PathLike[bytes] object as str (GH-28323) (GH-29111)
An object implementing the os.PathLike protocol can represent a file
system path as a str or bytes object.
Therefore, _infer_return_type function should infer os.PathLike[str]
object as str type and os.PathLike[bytes] object as bytes type.
(cherry picked from commit 6270d3eeaf)

Co-authored-by: Kyungmin Lee <rekyungmin@gmail.com>
2021-10-20 23:27:30 +02:00
Miss Islington (bot) 65de808811
bpo-45229: Make doctest tests discoverable (GH-28986) (GH-29095)
(cherry picked from commit 8d6740f489)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-20 18:52:22 +02:00
Miss Islington (bot) d6afe3be01
Cleanup a couple of comments left on PR 28775 post-merge. (GH-29079)
(cherry picked from commit 1dfac27dff)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2021-10-20 09:42:39 -07:00
Miss Islington (bot) b8dbb3a7f9
bpo-45436: Fix tkinter tests with Tcl/Tk 8.6.11+ (GH-29077) (GH-29080)
Since v8.6.11, a few configuration options seem to accept an empty value
where they did not previously; particularly the `type` of a `Menu`
widget, and the `compound` of any ttk widget with a label.  Providing an
explicit expected error message to `checkEnumParam` bypasses the check
of an empty value, which no longer raises `TclError`.
(cherry picked from commit 4fe454c6f5)

Co-authored-by: Zachary Ware <zach@python.org>
2021-10-20 16:30:57 +02:00
Miss Islington (bot) c15ba304f3
bpo-39679: Add tests for classmethod/staticmethod singledispatchmethods (GH-29034) (GH-29072)
In Python 3.8 and 3.9, stacking `@functools.singledispatchmethod` on top of
`@classmethod` or `@staticmethod` caused an exception to be raised if the
method was registered using type-annotations rather than
`@method.register(int)`. This was not caught by unit tests, however, as the
tests only tested the `@method.register(int)` way of registering additional
implementations. The bug is no longer present in Python 3.10+, but
`test_functools.py` is still lacking regression tests for these cases. This
commit adds these test cases.
(cherry picked from commit ad6d162e51)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-10-20 00:07:13 +02:00
Łukasz Langa 5c9cab595e
[3.10] bpo-45494: Fix parser crash when reporting errors involving invalid continuation characters (GH-28993) (GH-29070)
There are two errors that this commit fixes:

* The parser was not correctly computing the offset and the string
  source for E_LINECONT errors due to the incorrect usage of strtok().
* The parser was not correctly unwinding the call stack when a tokenizer
  exception happened in rules involving optionals ('?', [...]) as we
  always make them return valid results by using the comma operator. We
  need to check first if we don't have an error before continuing..
(cherry picked from commit a106343f63)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-10-19 22:31:18 +02:00
Łukasz Langa 325b2c2234
[3.10] bpo-45500: Rewrite test_dbm (GH-29002) (GH-29069)
* Generate test classes at import time. It allows to filter them when
  run with unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
* Create a database class in a new directory which will be removed after
  test. It guarantees that all created files and directories be removed
  and will not conflict with other dbm tests.
* Restore dbm._defaultmod after tests. Previously it was set to the last
  dbm module (dbm.dumb) which affected other tests.
* Enable the whichdb test for dbm.dumb.
* Move test_keys to the correct test class. It does not test whichdb().
* Remove some outdated code and comments..
(cherry picked from commit 975b94b9de)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-19 22:21:03 +02:00
Miss Islington (bot) 97ce855ca8
bpo-45475: Revert `__iter__` optimization for GzipFile, BZ2File, and LZMAFile. (GH-29016)
This reverts commit d2a8e69c2c.
(cherry picked from commit 0a4c82ddd3)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-10-18 20:15:48 -07:00
Miss Islington (bot) 65c1db794e
bpo-45229: Make test_http_cookiejar discoverable (GH-29004)
(cherry picked from commit b3f0ceae91)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-17 09:47:03 -07:00
Miss Islington (bot) a294703073
[3.10] bpo-45495: Add 'case' and 'match' to IDLE completions list. (GH-29000) (GH-29001)
Since the keyword list is frozen, only compute it once per
session.  The colorizer already handles context keywords.
(cherry picked from commit 42ac06dcd2)


Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

Automerge-Triggered-By: GH:terryjreedy
2021-10-16 16:14:11 -07:00
Miss Islington (bot) 5df35faf36
bpo-45249: Fix caret location when end_offset is set to 0 (GH-28855)
(cherry picked from commit fe0d9e22a5)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-10-16 10:51:05 -07:00