Commit graph

117424 commits

Author SHA1 Message Date
Serhiy Storchaka
9cd366462b
[3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and Py… (#106041)
[3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034)

These functions are broken by design because they discard any exceptions raised
inside, including MemoryError and KeyboardInterrupt.  They should not be
used in new code.
(cherry picked from commit 1d33d53780)
2023-06-24 16:36:34 -07:00
Miss Islington (bot)
746c0f3d8f
[3.12] gh-106033: [docs] Improve C API GetItem & HasAttr notes. (GH-106047) (#106070)
gh-106033: [docs] Improve C API GetItem & HasAttr notes. (GH-106047)

Use a note:: tag so that these dict and object API deficiencies show up clearly.

A caution:: tag was considered, but our current python docs rendering doesn't do much with that (no box or color change).  warning:: seemed too extreme.  note looks good.
(cherry picked from commit 19d6511b0b)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-06-24 16:30:27 -07:00
Barney Gale
ef58c0428d
[3.12] GH-104375: Use versionchanged to describe new arguments in pathlib docs (GH-104376, GH-106058)
(cherry picked from commit 4a6c84fc1e)
2023-06-24 16:25:47 +01:00
Miss Islington (bot)
de1c090879
[3.12] Typing docs: fix typo in annotating tuples comment (GH-106048) (#106049)
Typing docs: fix typo in annotating tuples comment (GH-106048)
(cherry picked from commit 8ef0ee4ebc)

Co-authored-by: Eamon Tracey <66919574+EamonTracey@users.noreply.github.com>
2023-06-23 21:35:00 +01:00
Miss Islington (bot)
7d6ee298e9
[3.12] gh-105974: Revert unintentional behaviour change for protocols with non-callable members and custom __subclasshook__ methods (GH-105976) (#106032)
gh-105974: Revert unintentional behaviour change for protocols with non-callable members and custom `__subclasshook__` methods (GH-105976)
(cherry picked from commit 9499b0f138)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-23 15:26:37 +00:00
Miss Islington (bot)
1ffcd49be2
[3.12] Typing docs: improve the guidance on annotating tuples (GH-106021) (#106027)
Typing docs: improve the guidance on annotating tuples (GH-106021)
(cherry picked from commit 968435ddb1)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-23 15:48:29 +01:00
Miss Islington (bot)
3cc5523312
[3.12] Docs: Avoid a DeprecationWarning in pyspecific.py when running with Sphinx >=6.1 (GH-105886) (#106010)
Docs: Avoid a DeprecationWarning in `pyspecific.py` when running with Sphinx >=6.1 (GH-105886)
(cherry picked from commit a72683ba8e)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-06-23 09:07:58 +01:00
Miss Islington (bot)
c407ef0a8a
[3.12] gh-98931: Add custom error messages to invalid import/from with multiple targets (GH-105985) (#105991)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-22 16:28:06 +00:00
Miss Islington (bot)
025c9912ee
[3.12] stdtypes.rst: remove a period (GH-105959) (#105968)
stdtypes.rst: remove a period (GH-105959)
(cherry picked from commit c5a722be5f)

Co-authored-by: Mathieu Dupuy <deronnax@gmail.com>
2023-06-21 15:40:54 +01:00
Miss Islington (bot)
5729b418fe
[3.12] gh-104212: Explain how to port imp code to importlib (GH-105905) (#105952)
gh-104212: Explain how to port imp code to importlib (GH-105905)
(cherry picked from commit 7a56a4148c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-06-20 23:03:54 +00:00
Miss Islington (bot)
c5c8111acf
[3.12] gh-105915: Fix SyntaxWarning becoming a SyntaxError with -We in test_fstring (GH-105943) (#105945)
(cherry picked from commit 6e40ee6e84)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-06-20 15:08:29 +00:00
Thomas Wouters
e149448595 Merge branch '3.12' of https://github.com/python/cpython into 3.12 2023-06-20 15:32:39 +02:00
Thomas Wouters
e904c35c31 Post 3.12.0b3 2023-06-20 15:32:24 +02:00
Miss Islington (bot)
164fa93001
[3.12] gh-105915: Add 'r' prefix to not emit SyntaxWarning in test_fstring (GH-105940) (#105942)
(cherry picked from commit 4b431d2e90)

Co-authored-by: @sunmy2019
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-06-20 13:16:21 +00:00
Miss Islington (bot)
fea0d2fbaa
[3.12] gh-105938: Emit a SyntaxWarning for escaped braces in an f-string (GH-105939) (#105941)
(cherry picked from commit 6586cee27f)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-06-20 13:09:48 +00:00
Miss Islington (bot)
cc18a8b78a
[3.12] gh-105908: fix barry_as_FLUFL future import (GH-105909) (#105930)
(cherry picked from commit 28187a9c4f)

Co-authored-by: Crowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com>
2023-06-20 03:05:20 +00:00
Thomas Wouters
f992a60014 Python 3.12.0b3 2023-06-19 20:56:16 +02:00
Miss Islington (bot)
225cc4c043
[3.12] GH-105808: Fix a regression introduced in GH-101251 (GH-105910) (#105920)
GH-105808: Fix a regression introduced in GH-101251 (GH-105910)

Fix a regression introduced in pythonGH-101251, causing GzipFile.flush() to
not flush the compressor (nor pass along the zip_mode argument).
(cherry picked from commit 1858db7cbd)

Co-authored-by: T. Wouters <thomas@python.org>
2023-06-19 17:42:23 +00:00
Miss Islington (bot)
5e524ef346
[3.12] typing docs: Improve the intro to each section (GH-105901) (#105902)
typing docs: Improve the intro to each section (GH-105901)
(cherry picked from commit 4426279a43)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-19 01:02:48 +01:00
Miss Islington (bot)
1606cbc2fd
[3.12] gh-105844: Use devguide terminology to denote versions (GH-105882) (#105892)
(cherry picked from commit dba7217511)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-18 19:56:35 +02:00
Miss Islington (bot)
6baddd9fb2
[3.12] Docs: move sphinx-lint to pre-commit (GH-105750) (#105894)
Docs: move sphinx-lint to pre-commit (GH-105750)
(cherry picked from commit bc07c8f096)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-06-18 13:21:34 +01:00
Miss Islington (bot)
b34f1df5fa
[3.12] CI: Bump macOS build to use OpenSSL v3.0 (GH-105538) (#105867)
(cherry picked from commit 34e93d3998)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-16 19:34:46 +00:00
Miss Islington (bot)
560adb01f9
[3.12] GH-105840: Fix assertion failures when specializing calls with too many __defaults__ (GH-105863)
GH-105840: Fix assertion failures when specializing calls with too many __defaults__ (GH-105847)
(cherry picked from commit 2beab5bdef)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2023-06-16 18:29:55 +00:00
Miss Islington (bot)
32c0aeb8a7
[3.12] bpo-44530: Document the change in MAKE_FUNCTION behavior (GH-93189) (#105841)
bpo-44530: Document the change in MAKE_FUNCTION behavior (GH-93189)

* bpo-44530: Document the change in MAKE_FUNCTION behavior

Fixes dis module documentation for MAKE_FUNCTION due to 2f180ce2cb (bpo-44530, released as part of 3.11) removes the qualified name at TOS
(cherry picked from commit 486b52a315)

Co-authored-by: Alex Doe <alexdoesh@gmail.com>
2023-06-16 12:17:33 -05:00
Miss Islington (bot)
5ca707d1e4
[3.12] gh-104799: PEP 695 backward compatibility for ast.unparse (GH-105846) (#105862)
(cherry picked from commit 957a974d4f)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-06-16 16:59:25 +00:00
Miss Islington (bot)
e6982c5860
[3.12] gh-105834: Add tests for calling issubclass() between two protocols (GH-105835) (#105859)
Some parts of the implementation of `typing.Protocol` had poor test coverage
(cherry picked from commit 70c075c194)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-16 16:20:19 +00:00
Miss Islington (bot)
32d8b56dff
[3.12] CI: Remove docs build from Azure Pipelines (GH-105823) (#105854)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-06-16 11:30:36 +00:00
Miss Islington (bot)
1eeb2e62d0
[3.12] gh-105844: Consistently use 'minor version' for X.Y versions (GH-105851) (#105853)
(cherry picked from commit 0bffe1acd7)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-16 10:56:32 +02:00
Miss Islington (bot)
6f0f27eba0
[3.12] Fix inaccuracies in "Assorted Topics" section of "Defining Extension Types" tutorial (GH-104969) (#105850)
Fix inaccuracies in "Assorted Topics" section of "Defining Extension Types" tutorial (GH-104969)
(cherry picked from commit 0d0963737a)

Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
2023-06-16 13:26:40 +05:30
Miss Islington (bot)
f94cb788f9
[3.12] tarfile: Fix positional-only syntax in docs (GH-105770) (#105773)
The syntax used in the current docs (a / before any args) is invalid.

I think the right approach is for the arguments to arbitrary
filter functions to be treated as positional-only, meaning that users
can supply filter functions with any names for the argument. tarfile.py
only calls the filter function with positional arguments.
(cherry picked from commit 5cdd5ba49d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-06-15 22:43:19 -07:00
Miss Islington (bot)
0cb670f7e2
[3.12] gh-105433: Add pickle tests for PEP695 (GH-105443) (#105845)
(cherry picked from commit 1af8251d9e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-06-16 01:26:45 +00:00
Miss Islington (bot)
0add51672d
[3.12] GH-105588: Add missing error checks to some obj2ast_* converters (GH-105838)
GH-105588: Add missing error checks to some obj2ast_* converters (GH-105589)
(cherry picked from commit a4056c8f9c)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2023-06-15 23:12:01 +00:00
Miss Islington (bot)
e9cf5a324e
[3.12] gh-105820: Fix tok_mode expression buffer in file & readline tokenizer (GH-105828) (#105832)
(cherry picked from commit d382ad4915)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-06-15 17:21:58 +00:00
Miss Islington (bot)
abb4eaa46f
[3.12] gh-102541: Hide traceback in help prompt (gh-102614) (gh-105778)
gh-102541: Hide traceback in help prompt (gh-102614)
(cherry picked from commit ba516e70c6)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-06-15 23:56:04 +09:00
Miss Islington (bot)
3073e23229
[3.12] gh-105821: Use a raw f-string in test_httpservers.py (GH-105822) (#105824)
gh-105821: Use a raw f-string in test_httpservers.py (GH-105822)

Use a raw f-string in test_httpservers.py
(cherry picked from commit 09ce8c3b48)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-06-15 11:13:22 +00:00
Miss Islington (bot)
9012c55af8
[3.12] More reorganisation of the typing docs (GH-105787) (#105810)
More reorganisation of the typing docs (GH-105787)
(cherry picked from commit da911a6b22)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-15 07:12:42 +01:00
Miss Islington (bot)
1573f1605f
[3.12] Improve docs for typing.dataclass_transform (GH-105792) (#105809)
Improve docs for `typing.dataclass_transform` (GH-105792)
(cherry picked from commit 006a453205)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-15 07:12:26 +01:00
Miss Islington (bot)
335fbd65db
[3.12] gh-105196: Fix indentations of section headings in C API docs (GH-105672) (#105782)
gh-105196: Fix indentations of section headings in C API docs (GH-105672)
(cherry picked from commit d32e8d6070)

Co-authored-by: TATHAGATA ROY <royzen9495@gmail.com>
2023-06-14 22:30:00 -05:00
Miss Islington (bot)
638c2bacde
[3.12] gh-105800: Issue SyntaxWarning in f-strings for invalid escape sequences (GH-105801) (#105806)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-06-15 00:36:40 +00:00
Alex Waygood
52a2bbdc9d
[3.12] Typing docs: move the deprecated stuff below the non-deprecated stuff (#105781) (#105783) 2023-06-14 16:03:30 +01:00
Miss Islington (bot)
ad7371e407
[3.12] gh-105745: Fix open method of webbrowser.Konqueror (GH-105746) (#105777)
gh-105745: Fix open method of webbrowser.Konqueror (GH-105746)
(cherry picked from commit e5d45b7444)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-06-14 12:26:33 +00:00
Miss Islington (bot)
0a9346d3d8
[3.12] gh-105587: Remove assertion from _PyStaticObject_CheckRefcnt (GH-105638) (#105769)
gh-105587: Remove assertion from `_PyStaticObject_CheckRefcnt` (GH-105638)
(cherry picked from commit 6199fe3b32)

Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
2023-06-14 05:04:22 +00:00
Miss Islington (bot)
bc997b38b6
[3.12] gh-105699: Use a Thread-Local Variable for PKGCONTEXT (gh-105740) (gh-105765)
This fixes a race during import. The existing _PyRuntimeState.imports.pkgcontext is shared between interpreters, and occasionally this would cause a crash when multiple interpreters were importing extensions modules at the same time.  To solve this we add a thread-local variable for the value.  We also leave the existing state (and infrequent race) in place for platforms that do not support thread-local variables.
(cherry picked from commit b87d288275)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-06-14 01:34:26 +00:00
Miss Islington (bot)
26bc2cc061
[3.12] gh-105387: Limited C API implements Py_INCREF() as func (GH-105388) (#105763)
gh-105387: Limited C API implements Py_INCREF() as func (GH-105388)

In the limited C API version 3.12, Py_INCREF() and Py_DECREF()
functions are now implemented as opaque function calls to hide
implementation details.
(cherry picked from commit b542972dc1)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-06-14 01:05:01 +00:00
Eric Snow
33d3069c45
[3.12] gh-104812: Run Pending Calls in any Thread (gh-104813) (gh-105752)
For a while now, pending calls only run in the main thread (in the main interpreter).  This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.
(cherry picked from commit 757b402)
2023-06-14 00:50:08 +00:00
Miss Islington (bot)
75239d5ec1
[3.12] gh-105436: Ignore unrelated errors when checking empty env (GH-105742) (#105756)
gh-105436: Ignore unrelated errors when checking empty env (GH-105742)
(cherry picked from commit 4cefe3cf10)

Co-authored-by: Steve Dower <steve.dower@python.org>
2023-06-13 23:41:07 +00:00
Miss Islington (bot)
51b533ec50
[3.12] gh-98040: Fix importbench: use types.ModuleType() (GH-105743) (#105754)
gh-98040: Fix importbench: use types.ModuleType() (GH-105743)

Replace removed imp.new_module(name) with types.ModuleType(name).
(cherry picked from commit 457a459c78)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-06-13 22:59:02 +00:00
Miss Islington (bot)
27426d8983
[3.12] gh-102613: Bump recursion limit to fix running test_pathlib under Coverage (GH-105744) (#105749)
gh-102613: Bump recursion limit to fix running test_pathlib under Coverage (GH-105744)
(cherry picked from commit 4e80082723)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-06-13 21:21:04 +00:00
Miss Islington (bot)
c3a2cbb54d
[3.12] gh-105603: Change the PyInterpreterConfig.own gil Field (gh-105620) (gh-105731)
We are changing it to be more flexible that a strict bool can be for possible future expanded used cases.
(cherry picked from commit b97e14a806)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-06-13 17:42:56 +00:00
Miss Islington (bot)
9c51ea5d55
[3.12] gh-105718: Fix buffer allocation in tokenizer with readline (GH-105728) (#105729)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-06-13 15:53:51 +00:00