Commit Graph

114730 Commits

Author SHA1 Message Date
Miss Islington (bot) f43b3d51a9
[3.11] bpo-44817: Ignore additional errors in ntpath.realpath (GH-27574) (GH-100022)
(cherry picked from commit 124ecd6576)

Co-authored-by: Michael Förderer <michael.foerderer@gmx.de>
2022-12-08 01:02:06 -08:00
Miss Islington (bot) 42fde2d164
test_ast uses infinite_recursion() to prevent crash (GH-100104)
test.test_ast_recursion_limit() now uses infinite_recursion() of
test.support to prevent crashes on debug builds.

Before this change, the test crashed on ARM64 Windows 3.x buildbot
worker which builds Python in debug mode.
(cherry picked from commit cd67c1bb30)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-12-08 00:52:02 -08:00
Miss Islington (bot) d4426c8295
gh-100098: [Enum] insist on actual tuples, no subclasses, for auto (GH-100099)
When checking for auto() instances, only top-level usage is supported,
which means either alone or as part of a regular tuple. Other
containers, such as lists, dicts, or namedtuples, will not have auto()
transformed into a value.
(cherry picked from commit ded02ca54d)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-12-07 23:21:29 -08:00
Miss Islington (bot) 846898e5ab
gh-98778: Update HTTPError to initialize properly even if fp is None (gh-99966)
(cherry picked from commit dc8a86893d)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-12-07 20:17:23 -08:00
Miss Islington (bot) 2997f3913a
gh-83035: handle decorator with nested parens in inspect.getsource (GH-99654)
(cherry picked from commit 68e41295b8)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2022-12-07 09:26:11 -08:00
Miss Islington (bot) 2b97ddd512
gh-100050: Fix an assertion error when raising unclosed parenthesis errors in the tokenizer (GH-100065)
(cherry picked from commit 97e7004cfe)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Automerge-Triggered-By: GH:pablogsal
2022-12-07 01:18:00 -08:00
Pablo Galindo fbc3e1ed90 Post 3.11.1 2022-12-06 21:07:58 +00:00
Pablo Galindo a7a450f84a Python 3.11.1 2022-12-06 19:05:27 +00:00
Brandt Bucher 2182a71eed
[3.11] GH-99729: Unlink frames before clearing them (#100047) 2022-12-06 17:02:19 +00:00
Serhiy Storchaka 3fae04b10e
[3.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created (#99949)
It no longer emits a deprecation warning if the current event loop was set.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-12-06 16:15:44 +01:00
Miss Islington (bot) 235f5fd2ca
[3.11] gh-100001: Remove doc typo, add versionadded (GH-100042) (#100043)
(cherry picked from commit bed15f87ea)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-12-06 11:34:20 +01:00
Miss Islington (bot) 05031ee1f5
[Enum] Fix typos in the documentation (GH-99960)
(cherry picked from commit 2ae894b6d1)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2022-12-05 21:46:48 -08:00
Miss Islington (bot) b2ff0f761d
gh-100001: Also escape \s in http.server log messages. (GH-100038)
Also \ escape \s in the http.server BaseHTTPRequestHandler.log_message so
that it is technically possible to parse the line and reconstruct what the
original data was.  Without this a \xHH is ambiguious as to if it is a hex
replacement we put in or the characters r"\x" came through in the original
request line.
(cherry picked from commit 7e29398407)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-12-05 14:53:41 -08:00
Miss Islington (bot) a726f747e6
gh-100001: Omit control characters in http.server stderr logs. (GH-100002)
Replace control characters in http.server.BaseHTTPRequestHandler.log_message with an escaped \xHH sequence to avoid causing problems for the terminal the output is printed to.
(cherry picked from commit d8ab0a4dfa)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-12-05 13:39:22 -08:00
Miss Islington (bot) f3a58cece6
[3.11] dataclasses.rst: Prevent horizontal scrolling (gh-100025) (gh-100028)
dataclasses.rst: Prevent horizontal scrolling (gh-100025)
(cherry picked from commit 51ee0a29e9)

Co-authored-by: Ram Rachum <ram@rachum.com>

Co-authored-by: Ram Rachum <ram@rachum.com>
2022-12-05 13:59:34 -05:00
Miss Islington (bot) c206cc9d9e
gh-98680: Add PyBUF_* constants to the Limited API listing (GH-100018)
``PyBUF_*`` constants are marked as part of Limited API of Python 3.11+.
These were available in 3.11.0 with `Py_LIMITED_API` defined for 3.11,
and are necessary to use the buffer API. Omitting them in `stable_abi.toml`
was a mistake.
(cherry picked from commit f24738742c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-12-05 09:12:44 -08:00
Łukasz Langa 32a2193f67
[3.11] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) (#100016)
In case if only True/False be supported as boolean arguments in future,
we should continue to support 1/0 here.
(cherry picked from commit 922a6cf6c2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-12-05 17:58:40 +01:00
Miss Islington (bot) 4a7612fbec
gh-99892: test_unicodedata: skip test on download failure (GH-100011)
Skip test_normalization() of test_unicodedata if it fails to download
NormalizationTest.txt file from pythontest.net.
(cherry picked from commit 2488c1e1b6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-12-05 08:07:00 -08:00
Miss Islington (bot) 5533cf67e7
gh-100005: Skip test_script_as_dev_fd() on FreeBSD (GH-100006)
On FreeBSD, skip test_script_as_dev_fd() of test_cmd_line_script if
fdescfs is not mounted (at /dev/fd).
(cherry picked from commit 038b151963)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-12-05 06:07:48 -08:00
Luke Garland 374b0a2ace
[3.11] bpo-40882: Fix a memory leak in SharedMemory on Windows (GH-20684) (#99973)
bpo-40882: Fix a memory leak in SharedMemory on Windows (GH-20684)

In multiprocessing.shared_memory.SharedMemory(), the temporary view
returned by MapViewOfFile() should be unmapped when it is no longer
needed.

(cherry picked from commit 85c128e34d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-12-05 13:38:25 +01:00
Miss Islington (bot) 7f2bcc7aaa
gh-93464: [Enum] Add versionchanged tag (GH-99997)
(cherry picked from commit e3a3863cb9)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-12-05 02:45:37 -08:00
Miss Islington (bot) 9bcc68b045
gh-98458: unittest: bugfix for infinite loop while handling chained exceptions that contain cycles (GH-98459)
* Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks()
* Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you @iritkatriel for pointing it out)
* adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes
(cherry picked from commit 72ec518203)

Co-authored-by: AlexTate <0xalextate@gmail.com>
2022-12-04 12:06:42 -08:00
Miss Islington (bot) 7aa87bba05
gh-60203: Always pass True/False as boolean arguments in tests (GH-99983)
Unless we explicitly test non-bool values.
(cherry picked from commit 76f43fc09a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-12-04 04:50:46 -08:00
Ken Jin 9e38553132
[3.11] gh-99886: Fix crash when freeing objects with managed dictionaries (#99902)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-04 14:41:23 +08:00
Miss Islington (bot) 27218d0799
gh-85747: "Preface" section of asyncio-eventloop.rst: Switch to active voice and suggest other edits (GH-99784)
(cherry picked from commit bf26bdf6ac)

Co-authored-by: Brian Skinn <brian.skinn@gmail.com>
2022-12-03 16:59:06 -08:00
Miss Islington (bot) 4710a7589a
gh-99934: test_marshal.py: add more elements in test_deterministic_sets (GH-99935)
Existing elements do produce different output on x86_64, but they
do not on x86. Let's make the data longer to ensure it differs.
(cherry picked from commit c68573b339)

Co-authored-by: Alexander Kanavin <alex.kanavin@gmail.com>
2022-12-03 09:18:23 -08:00
Victor Stinner 9707bf228e
gh-99845: _PyObject_DictPointer(): fix dictoffset cast (#99922)
Cast size_t to Py_ssize_t, rather than casting it to long. On 64-bit
Windows, long is 32-bit whereas Py_ssize_t is 64-bit.
2022-12-01 14:07:58 +01:00
Sam James 88b754b605
[3.11] gh-99086: Fix -Wstrict-prototypes, -Wimplicit-function-declara… (GH-99919)
…tion warnings in configure.ac (GH-99406)

Follow up to 12078e78f6. (cherry picked from commit e35ca417fe)
2022-12-01 02:26:56 -08:00
Pablo Galindo Salgado 6282ef6c3f
[3.11] gh-99891: Fix infinite recursion in the tokenizer when showing warnings (GH-99893) (GH-99896)
Automerge-Triggered-By: GH:pablogsal.
(cherry picked from commit 417206a05c)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-12-01 00:57:04 -08:00
Miss Islington (bot) 0076ca48e9
gh-96192: fix os.ismount() to use a path that is str or bytes (GH-96194)
(cherry picked from commit 367f552129)

Co-authored-by: Christoph Anton Mitterer <calestyo@scientia.org>
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-11-30 15:31:49 -08:00
Miss Islington (bot) f4511d3ee9
[3.11] GH-98906 ```re``` module: ```search() vs. match()``` section should mention ```fullmatch()``` (GH-98916) (GH-99912)
GH-98906 ```re``` module: ```search() vs. match()``` section should mention ```fullmatch()``` (GH-98916)

Mention fullmatch along with search and match.
(cherry picked from commit e0f91deb59)

Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>

Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
2022-11-30 18:14:36 -05:00
Miss Islington (bot) 90701ebaf4
bpo-47220: Document the optional callback parameter of weakref.WeakMethod (GH-25491)
(cherry picked from commit 9628136fac)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2022-11-30 11:53:04 -08:00
Miss Islington (bot) 8dafefcace
gh-82836: fix private network check (GH-97733)
Fixes private checks for network objects. The previous method would incorrectly return True for a private check in cases such as "0.0.0.0/0".
(cherry picked from commit ed391090cc)

Co-authored-by: Pete Wicken <2273100+JamoBox@users.noreply.github.com>
2022-11-29 14:12:57 -08:00
Miss Islington (bot) d7c2e0a537
Docs: improve accuracy of socketserver reference (GH-24767)
(cherry picked from commit 052bc128ac)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2022-11-29 12:43:09 -08:00
Miss Islington (bot) fbe388162b
whatsnew-3.10: Mention PEP 647 in the Release highlights section. (GH-99853)
Mention PEP 647 in the Release highlights section.

Also re-ordered the list so it matches the order in the details sections below.
(cherry picked from commit d74a58872c)

Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
2022-11-29 12:41:05 -08:00
Miss Islington (bot) 2e9ea7b44b
gh-90717: Update the documentation for the altchars paremeter in base64 library (GH-94187)
(cherry picked from commit 05dfc539c2)

Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>
2022-11-29 08:29:03 -08:00
Miss Islington (bot) 74920aa27d
gh-99344, gh-99379, gh-99382: Fix issues in substitution of ParamSpec and TypeVarTuple (GH-99412)
* Fix substitution of TypeVarTuple and ParamSpec together in user generics.

* Fix substitution of ParamSpec followed by TypeVarTuple in generic aliases.

* Check the number of arguments in substitution in user generics containing a
  TypeVarTuple and one or more TypeVar.
(cherry picked from commit 8f2fb7dfe7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-29 06:46:53 -08:00
Miss Islington (bot) 5bbf8ed8fb
[3.11] gh-99811: Use correct variable to search for time in format string (GH-99812) (GH-99851)
(cherry picked from commit 1d1bb95abd)
Co-authored-by: cemysce <13400533+cemysce@users.noreply.github.com>
2022-11-28 19:16:49 +00:00
Miss Islington (bot) a2b84bbf77
`fnmatch` docs: link to `fnmatch.filter()`, not `builtins.filter()` (GH-99819)
(cherry picked from commit ca3e611b1f)

Co-authored-by: Matthew Hughes <34972397+matthewhughes934@users.noreply.github.com>
2022-11-28 10:17:07 -08:00
Miss Islington (bot) 5dce4ab736
gh-99249: Clarify "read-only" slots tp_bases & tp_mro (GH-99342)
These slots are marked "should be treated as read-only" in the
table at the start of the document.  That doesn't say anything about
setting them in the static struct.

`tp_bases` docs did say that it should be ``NULL`` (TIL!). If you
ignore that, seemingly nothing bad happens. However, some slots
may not be inherited, depending on which sub-slot structs are present.
(FWIW, NumPy sets tp_bases and is affected by the quirk -- though to
be fair, its DUAL_INHERIT code probably predates tp_bases docs, and
also the result happens to be benign.)

This patch makes things explicit.
It also makes the summary table legend easier to scan.

(cherry picked from commit 219696abb2)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-11-28 03:25:04 -08:00
Kumar Aditya 6f658dd60d
[3.11] bpo-31718: Fix io.IncrementalNewlineDecoder SystemErrors and segfaults (GH-18640) (#99841)
Co-authored-by: Oren Milman <orenmn@gmail.com>
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>

(cherry picked from commit 53eef27133)
2022-11-28 16:47:33 +05:30
Miss Islington (bot) 1e327059a3
bpo-41825: restructure docs for the os.wait*() family (GH-22356)
(cherry picked from commit 492dc02b01)

Co-authored-by: Georg Brandl <georg@python.org>
2022-11-28 01:48:52 -08:00
Miss Islington (bot) fce9516a0f
gh-51524: Fix bug when calling trace.CoverageResults with valid infile (GH-99629)
(cherry picked from commit 594de165bf)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-11-27 23:15:00 -08:00
Miss Islington (bot) f160996412
Docs: both sqlite3 "point examples" now adapt to str (GH-99823)
(cherry picked from commit 276643e207)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-11-27 13:21:00 -08:00
Miss Islington (bot) 366adc7c83
gh-91340: Document multiprocessing.set_start_method force parameter (GH-32339)
GH-91340

https://bugs.python.org/issue47184
(cherry picked from commit dfc2732a57)

Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>
Automerge-Triggered-By: GH:kumaraditya303
2022-11-27 10:05:59 -08:00
Miss Islington (bot) e4cfdaa45b
GH-87235: Make sure "python /dev/fd/9 9</path/to/script.py" works on macOS (GH-99768)
On macOS all file descriptors for a particular file in /dev/fd
share the same file offset, that is ``open("/dev/fd/9", "r")`` behaves
more like ``dup(9)`` than a regular open.

This causes problems when a user tries to run "/dev/fd/9" as a script
because zipimport changes the file offset to try to read a zipfile
directory. Therefore change zipimport to reset the file offset after
trying to read the zipfile directory.
(cherry picked from commit d08fb25769)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-27 03:19:02 -08:00
Miss Islington (bot) 8bb7fdaee8
doc: Remove backslashes in doctest grammar docs (GH-29346)
(cherry picked from commit 22860dbbc8)

Co-authored-by: George Zhang <geetransit@gmail.com>
2022-11-26 22:46:33 -08:00
Miss Islington (bot) 4ce1a827db
bpo-43327: Fix the docs for PyImport_ImportFrozenModuleObject() (GH-24659)
The docs stated that PyImport_ImportFrozenModuleObject() returns a
new reference, but it actually returns an int.

(cherry picked from commit 62a5dc13e9)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-11-26 22:37:08 -08:00
Miss Islington (bot) 193a25e89c
gh-91078: Return None from TarFile.next when the tarfile is empty (GH-91850)
(cherry picked from commit 78365b8e28)

Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-11-26 11:01:20 -08:00
Miss Islington (bot) fe9957241a
gh-99795: Fix typo in importlib.resources.abc (GH-99796)
Changing TraversableReader to TraversableResources at one place of the documentation.

See GH-99795 for more details.
(cherry picked from commit 5f8898216e)

Co-authored-by: busywhitespace <busywhitespace@tuta.io>
2022-11-26 10:12:23 -08:00