Commit graph

117246 commits

Author SHA1 Message Date
Erlend E. Aasland
04b76ece7f
[3.12] gh-105375: Improve _pickle error handling (#105475) (#105584)
(cherry picked from commit 89aac6f6b7)

Error handling was deferred in some cases, which could potentially lead
to exceptions being overwritten.
2023-06-09 18:08:32 +00:00
Miss Islington (bot)
65404930bd
[3.12] gh-105375: Improve error handling in compiler_enter_scope() (GH-105494) (#105581)
(cherry picked from commit 6c832ddcf2)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-09 17:23:45 +00:00
Miss Islington (bot)
bc365da711
[3.12] gh-105557: Remove duplicate sqlite3 test method (GH-105558) (#105561)
test_func_return_too_large_int() was defined twice.
Keep only the redefined method, as that also checks the tracebacks.
(cherry picked from commit b8fa7bda4f)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-09 17:15:55 +00:00
Miss Islington (bot)
16b1cdc87c
[3.12] gh-105564: Don't include artificial newlines in the line attribute of tokens (GH-105565) (#105579)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-06-09 16:58:14 +00:00
Miss Islington (bot)
97d846dc2b
[3.12] Clarify the supported cases in the tokenize module (GH-105569) (#105573)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-06-09 16:00:42 +00:00
Miss Islington (bot)
7c298d2dc5
[3.12] Miscellaneous improvements to the typing docs (GH-105529) (#105567)
Miscellaneous improvements to the typing docs (GH-105529)

Mostly, these are changes so that we use shorter sentences and shorter paragraphs. In particular, I've tried to make the first sentence introducing each object in the typing API short and declarative.
(cherry picked from commit 8e755923c9)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-09 15:37:33 +00:00
Victor Stinner
d29e86bea3
[3.12] gh-102304: Fix Py_INCREF() for limited C API 3.9 (#105553)
* gh-102304: Fix Py_INCREF() for limited C API 3.9 (#105550)

When Python is built in debug mode (Py_REF_DEBUG macro), Py_INCREF()
and Py_DECREF() of the limited C API 3.9 (and older) now call
Py_IncRef() and Py_DecRef(), since _Py_IncRef() and _Py_DecRef() were
added to Python 3.10.

(cherry picked from commit 7ba0fd9f87)

* gh-102304: Remove Py_INCREF() doc change (#105552)

Py_INCREF() was made compatible again with Python 3.9 and older in
the limited API of Python debug mode.

(cherry picked from commit 58e4b69f69)
2023-06-09 10:32:46 +00:00
Miss Islington (bot)
2f4a2d6c1b
[3.12] gh-105332: [Enum] Fix unpickling flags in edge-cases (GH-105348) (GH-105520)
* revert enum pickling from by-name to by-value

(cherry picked from commit 4ff5690e59)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-06-08 18:01:51 -07:00
Miss Islington (bot)
68eeab7fdd
[3.12] CI: Configure macOS build as per updated devguide recommendations (GH-105533) (#105536)
(cherry picked from commit a5f23d4110)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-08 23:00:53 +00:00
Miss Islington (bot)
77c03a3b72
[3.12] gh-100227: Lock Around Modification of the Global Allocators State (gh-105516) (gh-105532)
The risk of a race with this state is relatively low, but we play it safe anyway. We do avoid using the lock in performance-sensitive cases where the risk of a race is very, very low.
(cherry picked from commit 68dfa49627)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-06-08 22:35:53 +00:00
Miss Islington (bot)
3eccd95f56
[3.12] gh-102832: IDLE - update stackviewer open (GH-105528) (#105534)
gh-102832: IDLE - update stackviewer open (GH-105528)

Use 'last_exc' instead of 'last_value' in 3.12/3.
(cherry picked from commit bb3454c1a7)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-06-08 22:29:24 +00:00
Miss Islington (bot)
f565fed548
[3.12] gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (GH-103339) (#105526)
gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (GH-103339)
(cherry picked from commit 3ee921d84f)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-06-08 21:57:33 +00:00
Eric Snow
b08ea9a561
[3.12] gh-100227: Lock Around Adding Global Audit Hooks (gh-105515) (gh-105525)
The risk of a race with this state is relatively low, but we play it safe anyway.
(cherry picked from commit e822a676f1)
2023-06-08 21:05:47 +00:00
Miss Islington (bot)
2ad2bd8b14
[3.12] gh-100227: Lock Around Use of the Global "atexit" State (gh-105514) (gh-105517)
The risk of a race with this state is relatively low, but we play it safe anyway.
(cherry picked from commit 7799c8e678)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-06-08 19:27:44 +00:00
Miss Islington (bot)
8698fa83f6
[3.12] gh-104310: Rename the New Function in importlib.util (gh-105255) (gh-105518)
The original name wasn't as clear as it could have been. This change includes the following:

* rename the function
* change the default value for "disable_check" to False
* add clues to the docstring that folks should probably not use the function

---------

(cherry picked from commit 34c63b86d3)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-06-08 19:00:04 +00:00
Miss Islington (bot)
1f90b2f57a
[3.12] test_types: Replace raw assert statements (GH-105500) (#105507)
(cherry picked from commit a8eb7372ee)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-06-08 15:19:11 +00:00
Miss Islington (bot)
3c5f0eadd8
[3.12] Further improve docs for typing.Annotated (GH-105498) (#105503)
Further improve docs for `typing.Annotated` (GH-105498)
(cherry picked from commit d213c2990f)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-08 15:12:35 +00:00
Miss Islington (bot)
2b6f475db8
[3.12] gh-105431: Remove unused stuff from test_typing.NewTypeTests (GH-105432) (#105489)
gh-105431: Remove unused stuff from `test_typing.NewTypeTests` (GH-105432)
(cherry picked from commit 9d35a71a76)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-06-08 06:57:21 +00:00
Barney Gale
ae25f1c8e5
[3.12] GH-104996: Defer joining of pathlib.PurePath() arguments. (GH-104999) (GH-105483)
Joining of arguments is moved to `_load_parts`, which is called when a
normalized path is needed.

(cherry picked from commit ffeaec7e60)
2023-06-08 00:25:45 +01:00
Miss Islington (bot)
4b2263e4bf
[3.12] gh-103171: Forward-port new tests for runtime-checkable protocols decorated with @final (GH-105473) (#105474)
Forward-port of the tests that were added to the 3.11 branch in GH-105445
(cherry picked from commit f5df347fcf)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 22:54:42 +00:00
Miss Islington (bot)
3d4a786b9b
[3.12] gh-105390: Add explicit type cast (GH-105466) (#105472) 2023-06-07 23:46:24 +01:00
Miss Islington (bot)
1e128779be
[3.12] gh-94673: Ensure subtypes are readied only once in math.trunc() (gh-105465) (gh-105471)
Fixes a typo in d2e2e53.
(cherry picked from commit 5394bf92aa)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2023-06-07 20:11:10 +00:00
Miss Islington (bot)
4eadfb1c1a
[3.12] gh-90015: Document that PEP-604 unions do not support forward references (GH-105366) (#105460)
gh-90015: Document that PEP-604 unions do not support forward references (GH-105366)
(cherry picked from commit fbdee000de)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 19:11:48 +01:00
Miss Islington (bot)
d3092573a8
[3.12] Fix grammar and improve clarity for an deprecation message. (GH-105457) (#105458) 2023-06-07 12:41:04 -05:00
Miss Islington (bot)
9a7c4a5f39
[3.12] typing: Improve documentation of generic classes and aliases (GH-105369) (#105453)
typing: Improve documentation of generic classes and aliases (GH-105369)
(cherry picked from commit d63a7c3694)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 15:04:14 +00:00
Miss Islington (bot)
d36aa244c8
[3.12] gh-105437: Improve tests of type params names for PEP 695 (GH-105438) (#105452)
(cherry picked from commit 76883af6bf)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-06-07 14:35:12 +00:00
Miss Islington (bot)
98ccc2de6b
[3.12] gh-105430: Remove typing._Immutable unused internal helper (GH-105434) (#105451)
gh-105430: Remove `typing._Immutable` unused internal helper (GH-105434)
(cherry picked from commit 18309ad94b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-06-07 14:30:39 +00:00
Miss Islington (bot)
241c36e1dc
[3.12] gh-97797: Improve documentation for typing.Annotated (GH-105365) (#105448)
gh-97797: Improve documentation for typing.Annotated (GH-105365)
(cherry picked from commit e26d296984)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 14:57:25 +01:00
Miss Islington (bot)
92ab560ef5
[3.12] Improve docs for typing.TypeAlias (GH-105372) (#105446)
Improve docs for `typing.TypeAlias` (GH-105372)
(cherry picked from commit c5ec51ec8f)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 14:45:54 +01:00
Miss Islington (bot)
117c153d9f
[3.12] gh-105435: Fix spurious NEWLINE token if file ends with comment without a newline (GH-105442) (#105444) 2023-06-07 14:07:57 +01:00
Miss Islington (bot)
bb6ea72003
[3.12] gh-105375: Improve error handling in sqlite3 collation callback (GH-105412) (#105440)
Check for error after each call to PyUnicode_FromStringAndSize().
(cherry picked from commit a24a780d93)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-07 11:43:18 +00:00
Miss Islington (bot)
c84d4d165d
[3.12] gh-105390: Correctly raise TokenError instead of SyntaxError for tokenize errors (GH-105399) (#105439) 2023-06-07 12:38:36 +01:00
Erlend E. Aasland
c607551baf
[3.12] gh-89886: Use Autoconf quadrigraphs where appropriate (#105226) (#105423) 2023-06-07 07:41:17 +00:00
Miss Islington (bot)
2cfe778d7f
[3.12] Improve code examples in typing.rst (GH-105346) (#105422)
Improve code examples in `typing.rst` (GH-105346)
(cherry picked from commit 81c81328a4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 08:00:22 +01:00
Miss Islington (bot)
a36fb691ac
[3.12] typing docs: Make the PEPs list an expandable section, hidden by default (GH-105353) (#105420)
typing docs: Make the PEPs list an expandable section, hidden by default (GH-105353)
(cherry picked from commit d7645124f5)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-06-07 07:48:44 +01:00
Miss Islington (bot)
ca4649a764
[3.12] GH-95088: Clarify rules for parsing an item key for format strings (GH-103779) (#105419)
GH-95088: Clarify rules for parsing an item key for format strings (GH-103779)
(cherry picked from commit 3e7316d7e8)

Co-authored-by: achhina <amanschhina@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-06-06 20:56:16 -07:00
Miss Islington (bot)
f4969eb315
[3.12] typing.NewType docs: the future performance improvements are now in the past (GH-105354) (#105414)
`typing.NewType` docs: the future performance improvements are now in the past (GH-105354)
(cherry picked from commit 5f65ff0370)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-06 20:55:37 -07:00
Miss Islington (bot)
84133c56f3
[3.12] gh-105286: Further improvements to typing.py docstrings (GH-105363) (#105416)
gh-105286: Further improvements to `typing.py` docstrings (GH-105363)
(cherry picked from commit 9a89f1bf1e)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 00:51:16 +00:00
Thomas Wouters
8b895929dd Merge branch '3.12' of https://github.com/python/cpython into 3.12 2023-06-06 21:47:00 +02:00
Thomas Wouters
9824a28a76 Post 3.12.0b2 2023-06-06 21:46:44 +02:00
Miss Islington (bot)
e33add429f
gh-92658: Fix typo in docs and tests for HV_GUID_PARENT (GH-105267)
(cherry picked from commit 3907de12b5)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-06-06 20:27:10 +01:00
Miss Islington (bot)
6fe0a6ba73
[3.12] sliding_window() recipe: Raise ValueError for non-positive window sizes. Add more tests. (GH-105403) (GH-105405) 2023-06-06 14:00:17 -05:00
Miss Islington (bot)
bf62e06e59
[3.12] gh-94172: Update keyfile removal documentation (GH-105392) (#105402)
gh-94172: Update keyfile removal documentation (GH-105392)

Remove the "deprecated:: 3.6" markup, since the parameters (like
keyfile and certfile) got removed in Python 3.12.
(cherry picked from commit 2b8e6e5712)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-06-06 18:14:55 +00:00
Victor Stinner
2bbb557b0f
[3.12] gh-102304: Fix Py_INCREF() stable ABI in debug mode (#104763) (#105352)
gh-102304: Fix Py_INCREF() stable ABI in debug mode (#104763)

When Python is built in debug mode (if the Py_REF_DEBUG macro is
defined), the Py_INCREF() and Py_DECREF() function are now always
implemented as opaque functions to avoid leaking implementation
details like the "_Py_RefTotal" variable or the
_Py_DecRefTotal_DO_NOT_USE_THIS() function.

* Remove _Py_IncRefTotal_DO_NOT_USE_THIS() and
  _Py_DecRefTotal_DO_NOT_USE_THIS() from the stable ABI.
* Remove _Py_NegativeRefcount() from limited C API.

(cherry picked from commit 92022d8416)
2023-06-06 16:22:04 +02:00
Thomas Wouters
e6c0efa25a Python 3.12.0b2 2023-06-06 16:16:21 +02:00
Miss Islington (bot)
2d9ead219e
[3.12] GH-105162: Account for INSTRUMENTED_RESUME in gen.close/throw. (GH-105187) (#105378)
GH-105162: Account for `INSTRUMENTED_RESUME` in gen.close/throw. (GH-105187)
(cherry picked from commit 601ae09f0c)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2023-06-06 14:06:44 +00:00
Miss Islington (bot)
260ba1fcdb
[3.12] gh-104411: Update test_getint for Tcl 9.0 (GH-104412) (#105356)
gh-104411: Update test_getint for Tcl 9.0 (GH-104412)
(cherry picked from commit 2c49c759e8)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2023-06-06 10:04:07 -04:00
Miss Islington (bot)
27cbeb08b8
[3.12] gh-104399: Use newer libtommath APIs when necessary (GH-104407) (#105343)
gh-104399: Use newer libtommath APIs when necessary (GH-104407)
(cherry picked from commit 00d73caf80)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2023-06-06 10:01:28 -04:00
Victor Stinner
82ab13c49a
[3.12] gh-102304: doc: Add links to Stable ABI and Limited C API (#105345) (#105371)
* gh-102304: doc: Add links to Stable ABI and Limited C API (#105345)

* Add "limited-c-api" and "stable-api" references.
* Rename "stable-abi-list" reference to "limited-api-list".
* Makefile: Document files regenerated by "make regen-limited-abi"
* Remove first empty line in generated files:

  - Lib/test/test_stable_abi_ctypes.py
  - PC/python3dll.c

(cherry picked from commit bae415ad02)

* gh-102304: Fix up Simple ABI doc (GH-105351)

(cherry picked from commit 0202aa002e)
2023-06-06 13:11:28 +00:00
Miss Islington (bot)
67b288f8be
[3.12] gh-105259: Ensure we don't show newline characters for trailing NEWLINE tokens (GH-105364) (#105367) 2023-06-06 14:47:45 +02:00