Commit graph

117215 commits

Author SHA1 Message Date
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
Erlend E. Aasland
6f3a4fd4f2
[3.12] gh-90005: Don't link with libbsd if not needed (#105236) (#105360)
The regression was introduced with commit 5b946cada.
Restore pre gh-29696 behaviour.
2023-06-06 10:58:13 +00:00
Miss Islington (bot)
3aa3be4fe3
[3.12] gh-105324: Fix tokenize module main function for stdin (GH-105325) (#105330) 2023-06-05 21:44:20 +02:00
Miss Islington (bot)
ab660e9a53
[3.12] gh-89412: Add missing attributes (added in 3.10) to traceback module docs (GH-105046) (#105327)
(cherry picked from commit a4f72fa39a)

Co-authored-by: Jakub Kuczys <me@jacken.men>
2023-06-05 19:02:14 +02:00
Miss Islington (bot)
05b6153456
[3.12] gh-97908: CAPI docs: Remove repeated struct names from member docs (GH-100054) (#105057)
And add raw HTML fragments to keep old links working.
(cherry picked from commit 1668b41dc4)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2023-06-05 18:24:12 +02:00
Hugo van Kemenade
0c51318c58
[3.12] What's New in 3.12: List 'Improved Modules' alphabetically (GH-105315) (#105321) 2023-06-05 18:28:03 +03:00
Miss Islington (bot)
dbc179e7c3
[3.12] Clarify that error messages are better with PEP 701 (GH-105150) (#105169)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
2023-06-05 18:09:11 +03:00
Alex Waygood
83fc562ea5
[3.12] gh-105286: Improve typing.py docstrings (#105287) (#105319)
gh-105286: Improve `typing.py` docstrings (#105287)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-06-05 15:05:21 +00:00
Miss Islington (bot)
2031238eb6
[3.12] gh-105280: Ensure isinstance([], collections.abc.Mapping) always evaluates to False (GH-105281) (#105318)
gh-105280: Ensure `isinstance([], collections.abc.Mapping)` always evaluates to `False` (GH-105281)
(cherry picked from commit 08756dbba6)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-05 14:51:26 +00:00
Miss Islington (bot)
51750269cf
[3.12] gh-105237: Allow calling issubclass(X, typing.Protocol) again (GH-105239) (#105316)
gh-105237: Allow calling `issubclass(X, typing.Protocol)` again (GH-105239)
(cherry picked from commit cdfb201bfa)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-05 14:06:25 +00:00
Miss Islington (bot)
6d0354167f
[3.12] gh-105164: Detect annotations inside match blocks (GH-105177) (#105313)
(cherry picked from commit 69d1245685)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-06-05 13:42:31 +00:00
Miss Islington (bot)
3e7ddc29a3
[3.12] gh-98963: Restore the ability to have a dict-less property. (GH-105262) (#105297)
gh-98963: Restore the ability to have a dict-less property. (GH-105262)

Ignore doc string assignment failures in `property` as has been the
behavior of all past Python releases.  (the docstring is discarded)
(cherry picked from commit 418befd75d)

This fixes a behavior regression in 3.12beta1 where an AttributeError was being raised in a situation it has never been in the past. It keeps the existing unusual single situation where AttributeError does get raised.

Existing widely deployed projects depend on this not raising an exception.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-06-05 03:45:12 +00:00
Miss Islington (bot)
9ce3312cdb
[3.12] gh-104882: Docs: fix description of relationship between socket.getblocking() and socket.gettimeout() (GH-105026) (#105283)
gh-104882: Docs: fix description of relationship between `socket.getblocking()` and `socket.gettimeout()` (GH-105026)
(cherry picked from commit 5a5ed7a3e6)

Co-authored-by: Joe Geisbauer <joegeisbauer@gmail.com>
2023-06-04 17:07:59 +01:00
Miss Islington (bot)
6b61fe9097
[3.12] Fix typo in Python 3.12 What's New (GH-105278) (#105282)
Fix typo in Python 3.12 What's New (GH-105278)
(cherry picked from commit 9a90c9ace2)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-06-04 16:50:27 +01:00
Miss Islington (bot)
c7a9d96a25
[3.12] gh-104690 Disallow thread creation and fork at interpreter finalization (GH-104826) (#105277)
gh-104690 Disallow thread creation and fork at interpreter finalization (GH-104826)

Disallow thread creation and fork at interpreter finalization.

in the following functions, check if interpreter is finalizing and raise `RuntimeError` with appropriate message:
* `_thread.start_new_thread` and thus `threading`
* `posix.fork`
* `posix.fork1`
* `posix.forkpty`
* `_posixsubprocess.fork_exec` when a `preexec_fn=` is supplied.

---------

(cherry picked from commit ce558e69d4)

Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-06-04 04:32:00 +00:00
Miss Islington (bot)
f629d5fc24
[3.12] gh-89415: Mention new IP_* constants in socket module in the docs (GH-105266) (#105270)
gh-89415: Mention new `IP_*` constants in `socket` module in the docs (GH-105266)
(cherry picked from commit eaff9c39aa)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-06-03 08:29:18 -07:00
Miss Islington (bot)
d3922c4688
[3.12] gh-105080: Fixed inconsistent signature on derived classes (GH-105217) (#105257)
gh-105080: Fixed inconsistent signature on derived classes (GH-105217)
(cherry picked from commit 9ad199ba36)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2023-06-02 17:05:49 -06:00
Miss Islington (bot)
72d5dfaa8f
[3.12] gh-104614: Fix potential ref. leak in _testcapimodule/get_basic_static_type() (GH-105225) (#105248)
(cherry picked from commit e01b04c907)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-02 17:09:51 +00:00
Miss Islington (bot)
00fe6186cb
[3.12] gh-102778: update documentation of PyErr_PrintEx and traceback.print_last() regarding sys.last_exc (GH-105190) (#105246)
gh-102778: update documentation of PyErr_PrintEx and traceback.print_last() regarding sys.last_exc (GH-105190)
(cherry picked from commit 0dafc785ee)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-06-02 17:04:22 +01:00
Miss Islington (bot)
103ae4e36e
[3.12] gh-105194: Fix format specifier escaped characters in f-strings (GH-105231) (#105234) 2023-06-02 14:53:27 +02:00
Miss Islington (bot)
46cc4f0f76
[3.12] gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (GH-105185) (#105218)
gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (GH-105185)
(cherry picked from commit ee26ca13a1)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-06-02 08:24:25 +00:00
Miss Islington (bot)
e6d5e63614
[3.12] gh-104799: Default missing lists in AST to the empty list (GH-104834) (#105213)
(cherry picked from commit 77d2579586)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-02 02:06:07 +00:00
Miss Islington (bot)
d57ee813eb
[3.12] gh-104614: Make Sure ob_type is Always Set Correctly by PyType_Ready() (gh-105122) (gh-105211)
When I added the relevant condition to type_ready_set_bases() in gh-103912, I had missed that the function also sets tp_base and ob_type (if necessary).  That led to problems for third-party static types.

We fix that here, by making those extra operations distinct and by adjusting the condition to be more specific.
(cherry picked from commit 1469393)

Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
2023-06-01 23:06:38 +00:00
Miss Islington (bot)
d2be5c73ed
[3.12] gh-104341: Call _PyEval_ReleaseLock() with NULL When Finalizing the Current Thread (gh-105109) (gh-105209)
This avoids the problematic race in drop_gil() by skipping the FORCE_SWITCHING code there for finalizing threads.

(The idea for this approach came out of discussions with @markshannon.)
(cherry picked from commit 3698fda)

Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
2023-06-01 22:50:28 +00:00
Miss Islington (bot)
c38ceb032d
[3.12] gh-105020: Share tp_bases and tp_mro Between Interpreters For All Static Builtin Types (gh-105115) (gh-105124)
In gh-103912 we added tp_bases and tp_mro to each PyInterpreterState.types.builtins entry.  However, doing so ignored the fact that both PyTypeObject fields are public API, and not documented as internal (as opposed to tp_subclasses).  We address that here by reverting back to shared objects, making them immortal in the process.
(cherry picked from commit 7be667d)

Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
2023-06-01 22:24:55 +00:00
Erlend E. Aasland
83c7386cee
[3.12] GH-89886: Bump to GNU Autoconf v2.71 (#104925) (#105207)
Co-authored-by: Christian Heimes <christian@python.org>
2023-06-01 22:19:19 +00:00
Miss Islington (bot)
25543aecfe
[3.12] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) (#105199)
gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174)

Upgrade builds to OpenSSL 1.1.1u.

This OpenSSL version addresses a pile if less-urgent CVEs since 1.1.1t.

The Mac/BuildScript/build-installer.py was already updated.

Also updates _ssl_data_111.h from OpenSSL 1.1.1u, _ssl_data_300.h from 3.0.9, and adds a new _ssl_data_31.h file from 3.1.1 along with the ssl.c code to use it.

Manual edits to the _ssl_data_300.h file prevent it from removing any existing definitions in case those exist in some peoples builds and were important (avoiding regressions during backporting).

backports of this prior to 3.12 will not include the openssl 3.1 header.
(cherry picked from commit ede89af605)

Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
2023-06-01 17:13:35 +00:00
Miss Islington (bot)
6375287b37
[3.12] gh-89886: Rely on HAVE_SYS_TIME_H (GH-105058) (#105192)
Quoting autoconf (v2.71):

    All current systems provide time.h; it need not be checked for.
    Not all systems provide sys/time.h, but those that do, all allow
    you to include it and time.h simultaneously.

(cherry picked from commit 9ab587b714)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-01 12:08:37 +00:00
Miss Islington (bot)
dbd7d7c8e1
gh-105146: Update links at end of Windows installer (uninstall/repair) (GH-105147)
(cherry picked from commit ed86e14b16)

Co-authored-by: Steve Dower <steve.dower@python.org>
2023-05-31 22:42:48 +01:00
Miss Islington (bot)
8b516668f2
[3.12] gh-102251: Explicitly free state for test modules with state in test_import (GH-105085) (#105170)
(cherry picked from commit a99b9d911e)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-31 21:34:21 +00:00
Eric Snow
f87c6d1894
[3.12] gh-102304: Fix 2 New Stable ABI Functions (gh-104762) (gh-105123) 2023-05-31 15:17:24 -06:00
Barney Gale
e7cb216339
[3.12] GH-105113: Improve performance of pathlib.PurePath.match() (GH-105114)
We now compile a `re.Pattern` object for the entire pattern. This is made
more difficult by `fnmatch` not treating directory separators as special
when evaluating wildcards (`*`, `?`, etc), and so we arrange the path parts
onto separate *lines* in a string, and ensure we don't set `re.DOTALL`.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-31 21:37:37 +01:00