Commit graph

114897 commits

Author SHA1 Message Date
Miss Islington (bot)
370498b12e
gh-97909: Fix markup for PyMethodDef members (GH-100089)
(cherry picked from commit 8edcb30c3f)

Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
2022-12-16 23:19:45 -08:00
Miss Islington (bot)
e3d85783e5
Document that zipfile's pwd parameter is a bytes object (GH-100209)
(cherry picked from commit 5ee7eb9deb)

Co-authored-by: JustAnotherArchivist <JustAnotherArchivist@users.noreply.github.com>
2022-12-16 22:54:33 -08:00
colorfulappl
dd323afea8
[3.11] gh-96002: Add functional test for Argument Clinic (GH-96178) (#100230)
(cherry picked from commit c450c8c9ed)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-17 12:04:54 +05:30
Miss Islington (bot)
4c810f92ba
gh-99830: asyncio: Document returns of remove_{reader,writer} (GH-100302)
(cherry picked from commit 5234e1cbea)

Co-authored-by: Ben Darnell <ben@bendarnell.com>
2022-12-16 11:14:28 -08:00
Miss Islington (bot)
138c2e6f3f
[3.11] "Compound statement" docs: Fix with-statement step indexing (GH-100286) (GH-100300)
Back in commit 226e6e7d43
an item was added to the list, renumbering all the rest of the
items, but the forward-reference wasn't updated to match.
(cherry picked from commit f23236a92d)

Co-authored-by: Frank Dana <ferdnyc@gmail.com>
2022-12-16 11:01:24 -08:00
Miss Islington (bot)
9d2dcbbccd
[3.11] Remove uninformative itertools recipe (GH-100253) (GH-100275) 2022-12-15 12:47:58 -06:00
Miss Islington (bot)
cb1001ce23
gh-100248: Add missing ssl_shutdown_timeout parameter in asyncio docs (GH-100249)
(cherry picked from commit 9663853800)

Co-authored-by: busywhitespace <busywhitespace@tuta.io>
2022-12-14 09:07:36 -08:00
Miss Islington (bot)
cd4166fec2
GH-100206: use versionadded for the addition of sysconfig.get_default_scheme (GH-100207)
(cherry picked from commit d3ea82aaf9)

Co-authored-by: Filipe Laíns <lains@riseup.net>
2022-12-13 03:02:41 -08:00
Miss Islington (bot)
60383a3cd8
Fix: typo (Indention) (GH-99904)
Example needed to be indented. Was trying to call a context manger `pr` (from ` with cProfile.Profile() as pr:`) wot perform ` pr.print_stats()` once it had already exited.
(cherry picked from commit 8711b59f7a)

Co-authored-by: jarrodcolburn <jcourtlandcolburn@gmail.com>
Automerge-Triggered-By: GH:AlexWaygood
2022-12-12 04:38:39 -08:00
Miss Islington (bot)
17bc55e043
clarify the 4300-digit limit on int-str conversion (GH-100175)
(cherry picked from commit 935ef59321)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2022-12-12 04:06:48 -08:00
Miss Islington (bot)
71b032635d
gh-70393: Clarify mention of "middle" scope (GH-98839)
(cherry picked from commit 70be5e42f6)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-11 20:25:06 -08:00
Miss Islington (bot)
593c5a0247
gh-100174: [Enum] Correct PowersOfThree example. (GH-100178)
Changed from multiples of 3 to powers of 3 to match the class name.
(cherry picked from commit 868bab0fdc)

Co-authored-by: Beweeted <Beweeted@users.noreply.github.com>
2022-12-11 15:30:25 -08:00
Miss Islington (bot)
606adb4b89
gh-99728: correct typo in datetime format codes documentation (GH-99750)
(cherry picked from commit d5f8a2b6ad)

Co-authored-by: Brad Wolfe <brad.wolfe@gmail.com>
2022-12-10 02:29:04 -08:00
Miss Islington (bot)
9aca00341a
gh-100049: fix repr for mappingproxy in dictionary view example doc (GH-100052)
(cherry picked from commit 7c0fb71fbf)

Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
2022-12-10 01:23:24 -08:00
Miss Islington (bot)
3939a4b7d9
bpo-43984: Allow winreg.SetValueEx to set -1 without treating it as an error (GH-25775)
(cherry picked from commit a29a7b9b78)

Co-authored-by: Shreyan Avigyan <shreyan.avigyan@gmail.com>
2022-12-09 05:12:43 -08:00
Miss Islington (bot)
ecb16d5d63
gh-96250: Improve sqlite3 injection attack example (GH-99270)
(cherry picked from commit 41d4ac9da3)

Co-authored-by: Jia Junjie <62194633+jiajunjie@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-08 12:45:40 -08:00
Miss Islington (bot)
0274a3bc3b
Use sphinxext-opengraph to generate OpenGraph metadata (GH-99931)
(cherry picked from commit f49c735e52)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-12-08 09:34:52 -08:00
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