Commit graph

110782 commits

Author SHA1 Message Date
Miss Islington (bot)
fef54abf5f
bpo-45583: Correct datamodel documentation of int() (GH-29182) (GH-29285)
It should be noted that this part of the documentation is redundant with
function.rst's documentation of int. This one was correctly updated with Python 3.8.
(cherry picked from commit d9c1868c25)

Co-authored-by: Arthur Milchior <arthur@milchior.fr>
2021-10-28 22:17:06 +02:00
Miss Islington (bot)
fb80aede6a
bpo-45604: add level argument to multiprocessing.log_to_stderr func (GH-29226) (GH-29283)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 1fb968c07a)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-10-28 21:58:24 +02:00
Miss Islington (bot)
1d88b2b0a1
bpo-45608: Document missing sqlite3 DB-API attributes and methods (GH-29219) (GH-29281)
(cherry picked from commit 88d8a1a340)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-10-28 21:57:14 +02:00
Sam Gross
9e0012116a
[3.10] bpo-28737: Document when tp_dealloc should call PyObject_GC_UnTrack() (GH-29246) (GH-29249)
Objects that support garbage collection ("container" objects) should
call PyObject_GC_UnTrack() from their destructors before clearing any
fields which may point to other "container" objects.
(cherry picked from commit 35e1ff38ee)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2021-10-28 21:22:57 +02:00
Miss Islington (bot)
54579087c6
bpo-44828: Avoid tkinter file dialog failure on macOS 12 Monterey (GH-29276)
when using the Tk 8.6.11 provided by python.org macOS installers.
Patch by Marc Culler of the Tk project.
(cherry picked from commit be8318be05)

Co-authored-by: Ned Deily <nad@python.org>
2021-10-28 11:43:04 -07:00
Miss Islington (bot)
99495b8aff
Fix typo in Counter documentation (GH-29223)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 0a68b3603f)

Co-authored-by: Justinas Petuchovas <justinas.petuchovas@gmail.com>
2021-10-28 04:06:04 -07: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)
038f452308
bpo-45562: Print tokenizer debug messages to stderr (GH-29250) (GH-29252)
(cherry picked from commit 10bbd41ba8)

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

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-10-27 22:45:43 +01:00
Miss Islington (bot)
2b7b7c7320
bpo-45618: Fix documentation build by pinning Docutils version to 0.17.1 (GH-29230) (GH-29240)
Co-authored-by: Maciej Olko <maciej.olko@yougov.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
(cherry picked from commit bcee6aa315)
2021-10-27 10:37:17 -04: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)
cadf06eab7
bpo-45574: fix warning about print_escape being unused (GH-29172) (#29176)
It used to be like this:
<img width="1232" alt="Снимок экрана 2021-10-22 в 23 07 40" src="https://user-images.githubusercontent.com/4660275/138516608-fef6ec01-a96a-40f4-81ef-52265b0f536b.png">

Quick `grep` tells that it is just used in one place under `Py_DEBUG`: f6e8b80d20/Parser/tokenizer.cGH-L1047-L1051
<img width="752" alt="Снимок экрана 2021-10-22 в 23 08 09" src="https://user-images.githubusercontent.com/4660275/138516684-ea503136-1e92-48a5-95bb-419e190d5866.png">

I am not sure, but it also looks like a private thing, it should not affect other users.

Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit 4bc5473a42)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-10-23 14:35:48 +01: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)
19903085c3
bpo-45571: use PY_CFLAGS_NODIST for shared Modules/Setup (GH-29161)
(cherry picked from commit f6e8b80d20)

Co-authored-by: Christian Heimes <christian@python.org>
2021-10-22 11:22:01 -07:00
Miss Islington (bot)
ae78ffdc93
bpo-45562: Only show debug output from the parser in debug builds (GH-29140) (#29149)
(cherry picked from commit 86dfb55d2e)

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

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-10-22 11:14:47 +01: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)
9b3cda5687
bpo-44344: Document that pow can return a complex number for non-complex inputs. (GH-27853) (GH-29135)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 887a55705b)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2021-10-22 00:08:20 +02:00
Miss Islington (bot)
8fd7e8965d
bpo-41983: add availability info to socket docs (GH-27519) (GH-29136)
* add availability info to AF_PACKET section
* add availability for AF_QIPCRTR as well

(cherry picked from commit 51375388be)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-10-22 00:07:07 +02: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
828722aca4
[3.10] bpo-44174: [Enum] add reference to name mangling (GH-29117) 2021-10-21 09:50:29 -07:00
Miss Islington (bot)
1cdac61065
bpo-45521: Fix a bug in the obmalloc radix tree code. (GH-29051) (GH-29122)
MAP_BOT_LENGTH was incorrectly used to compute MAP_TOP_MASK instead of
MAP_TOP_LENGTH. On 64-bit machines, the error causes the tree to hold
46-bits of virtual addresses, rather than the intended 48-bits.
(cherry picked from commit 311910b31a)
2021-10-21 08:39:58 -07:00
Miss Islington (bot)
00ddc1fbd7
bpo-34451: Document prompt and output toggle feature in html tutorial (GH-27105) (GH-29119)
(cherry picked from commit 5a14f71fe8)

Co-authored-by: Thomas <thmsdnnr@gmail.com>
2021-10-21 14:41:32 +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)
b2a989995e
bpo-45464: [doc] Explain that subclassing multiple exceptions is fragile (GH-29094) (GH-29104)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
(cherry picked from commit dff0b71343)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-20 20:50:09 +02:00
Miss Islington (bot)
696a89fef8
bpo-45532: Replace 'default' with 'main' as default in sys.version (GH-29100)
(cherry picked from commit d2cd5eef0c)

Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com>
2021-10-20 10:41:35 -07: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)
5537b9f105
bpo-45536: Check OpenSSL APIs in configure (GH-29088)
(cherry picked from commit 81520fe677)

Co-authored-by: Christian Heimes <christian@python.org>
2021-10-20 08:46:32 -07:00
Miss Islington (bot)
0d0312e1ac
Add PEPs 593 & 647 to list of PEPs at top of typing docs (GH-29097)
(cherry picked from commit d9e1dae35a)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-10-20 08:36:34 -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)
092ec4b9d1
bpo-45449: add note about PEP 585 in collections.abc's documentation (GH-29047) (GH-29067)
Signed-off-by: Filipe Laíns <lains@riseup.net>

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 7bafa0cf58)
2021-10-19 20:41:33 +02:00
Miss Islington (bot)
8cef526a87
bpo-45515: Add zoneinfo to the datetime documentation (GH-29038) (GH-29065)
We should have done this way back when 3.9 was released, but it fell off
the radar.

Co-authored-by: Paul Ganssle <git@m.ganssle.io>
(cherry picked from commit 8e40ca127f)
2021-10-19 20:35:34 +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)
b1949e0b58
[3.10] bpo-45221: Fix handling of LDFLAGS and CPPFLAGS options in setup.py (GH-29031) (GH-29037)
(cherry picked from commit 6a533a4238)


Co-authored-by: andrei kulakov <andrei.avk@gmail.com>

Automerge-Triggered-By: GH:ned-deily
2021-10-18 11:49:28 -07:00
Miss Islington (bot)
7082abf53d
Improve multiserver queue recipe (GH-29012) (GH-29013) 2021-10-17 18:43:10 -05: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
Miss Islington (bot)
855d6247ad
[3.10]bpo-45463: Clarify that global statements allows multiple names (GH-28851) (GH-28989)
The global statement allows specifying a list of identifiers
(https://docs.python.org/3/reference/simple_stmts.htmlGH-the-global-statement).

The "Execution model" chapter described the global statement as if it
only allowed one single name. Pluralize "name" in the appropriate places.
(cherry picked from commit 4ecd119b00)

Co-authored-by: Luca Chiodini <luca@chiodini.org>

Co-authored-by: Luca Chiodini <luca@chiodini.org>
2021-10-16 10:01:54 -04:00
Miss Islington (bot)
2b6eb81496
bpo-45428: Fix reading filenames from stdin in py_compile (GH-28848)
Strip trailing '\n'.
(cherry picked from commit 59a633d3e2)

Co-authored-by: Graham Inggs <ginggs@debian.org>
2021-10-15 05:14:35 -07:00
Serhiy Storchaka
4641afef66
[3.10] bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" codec (GH-28944) (GH-28952)
They support now splitting escape sequences between input chunks.

Add the third parameter "final" in codecs.raw_unicode_escape_decode().
It is True by default to match the former behavior.
(cherry picked from commit 39aa98346d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-14 21:23:39 +03:00
Miss Islington (bot)
0bff4ccbfd
[3.10] bpo-45461: Fix IncrementalDecoder and StreamReader in the "unicode-escape" codec (GH-28939) (GH-28943)
They support now splitting escape sequences between input chunks.

Add the third parameter "final" in codecs.unicode_escape_decode().
It is True by default to match the former behavior.
(cherry picked from commit c96d1546b1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-14 20:02:20 +03:00
Dong-hee Na
70b150a366
[3.10] no-issue: Make silence about warning '_POSIX_C_SOURCE redefined' (GH-28948) (GH-28951) 2021-10-15 01:35:53 +09:00
Miss Islington (bot)
f40b230df9
bpo-45386: Handle strftime's ValueError graciously in xmlrpc.client (GH-28765) (GH-28934)
At import time, the xmlrpc.client module uses different date formats to
test strftime so it can format years with 4 digits consistently.
Depending on the underlying C library and its strftime implementation
some of these calls can result in ValueErrors, blocking the
xmlrpc.client module from being imported.

This commit changes the behavior of this bit of code to react to
ValueError exceptions, treating the format that caused them as an
non-viable option.
(cherry picked from commit 1c83135381)

Co-authored-by: rtobar <rtobarc@gmail.com>
2021-10-13 19:59:45 +02:00
Miss Islington (bot)
fd2be6da2f
bpo-24444: fix an error in argparse help when help for an option is blank (GH-28050) (GH-28931)
(cherry picked from commit 6fafc25aea)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-10-13 19:15:43 +02:00