Commit graph

110722 commits

Author SHA1 Message Date
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
Łukasz Langa
f8473f6f76
[3.10] bpo-45239: Fix parsedate_tz when time has more than 2 dots in it (GH-28452) (GH-28930)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit b9e687618d)

Co-authored-by: Ben Hoyt <benhoyt@gmail.com>
2021-10-13 19:12:22 +02:00
Miss Islington (bot)
151234f5da
bpo-45229: Make tkinter tests discoverable (GH-28637) (GH-28927)
(cherry picked from commit f59ed3c310)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-13 18:59:04 +02:00
Miss Islington (bot)
5abb2dec2c
[docs] lexical_analysis: Expand the text on `_` (GH-28903) (GH-28933)
Also:
* Expand the discussion into its own entry. (Even before this,
  text on ``_`` was longet than the text on ``_*``.)

* Briefly note the other common convention for `_`: naming unused
  variables.

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 3dee0cb621)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2021-10-13 18:58:06 +02:00
Miss Islington (bot)
7e74d99c53
bpo-45453: Fix test_embed.StdPrinterTests (GH-28916) (GH-28917)
test_embed.StdPrinterTests now always use the file descriptor 1 for
stdout, rather than using sys.__stdout__.fileno().
PyFile_NewStdPrinter() does crash if the argument is not 1 or 2.

Fix also a few pyflakes warnings: remove unused import and variables.
(cherry picked from commit 678433f25e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-10-13 12:24:47 +02:00
Miss Islington (bot)
47673c47db
bpo-20692: Add Programming FAQ entry for 1.__class__ error. (GH-28918)
To avoid error, add either space or parentheses.
(cherry picked from commit 380c440875)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-10-12 22:37:51 -07:00
Miss Islington (bot)
edae3e2ac7
[3.10] bpo-45405: Prevent `internal configure error when running configure` with recent versions of non-Apple clang. (GH-28845) (GH-28911)
Change the configure logic to function properly on macOS when the compiler
outputs a platform triplet for option --print-multiarch.

Co-authored-by: Ned Deily <nad@python.org>
(cherry picked from commit 9c4766772c)


Co-authored-by: David Bohman <debohman@gmail.com>

Automerge-Triggered-By: GH:ned-deily
2021-10-12 17:31:32 -07:00
Miss Islington (bot)
854db7e821
Fix format string in _PyImport_LoadDynamicModuleWithSpec() (GH-28863)
(cherry picked from commit f79f3b41c8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-12 10:10:59 -07:00
Miss Islington (bot)
035ad8cf98
Slight correct grammar (GH-28860)
(cherry picked from commit 1b11582f0e)

Co-authored-by: nobodyatandnothing <91722596+nobodyatandnothing@users.noreply.github.com>
2021-10-12 10:01:11 -07:00
Miss Islington (bot)
32866dd471
bpo-45441: Update some moved URLs in documentation (GH-28861)
(cherry picked from commit b37dc9b3bc)

Co-authored-by: 180909 <wjh180909@gmail.com>
2021-10-12 07:20:43 -07:00
Miss Islington (bot)
47a50fe16f
bpo-45401: Fix a resource warning in test_logging (GH-28864) (GH-28872)
(cherry picked from commit 15188b115a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-12 10:19:09 +03:00