summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.12.8v3.12.8Thomas Wouters2024-12-03110-514/+1654
|
* [3.12] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings ↵Miss Islington (bot)2024-12-0310-20/+124
| | | | | | | | | | | | | | | | (gh-125205) Fix a crash caused by immortal interned strings being shared between sub-interpreters that use basic single-phase init. In that case, the string can be used by an interpreter that outlives the interpreter that created and interned it. For interpreters that share obmalloc state, also share the interned dict with the main interpreter. This is an un-revert of gh-124646 that then addresses the Py_TRACE_REFS failures identified by gh-124785 (i.e. backporting gh-125709 too). (cherry picked from commit f2cb39947093feda3ff85b8dc820922cc5e5f954, AKA gh-124865) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-126876: Fix socket internal_select() for large timeout (GH-126968) ↵Miss Islington (bot)2024-12-032-1/+34
| | | | | | | | | | | | | (#127003) gh-126876: Fix socket internal_select() for large timeout (GH-126968) If the timeout is larger than INT_MAX, replace it with INT_MAX, in the poll() code path. Add an unit test. (cherry picked from commit b3687ad454c4ac54c8599a10f3ace8a13ca48915) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) ↵Miss Islington (bot)2024-12-031-3/+11
| | | | | | | (GH-127558) (cherry picked from commit 35d37d6592d1be71ea76042165f6cbfa6c4c3a17) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938)Miss Islington (bot)2024-12-023-18/+35
| | | | | (cherry picked from commit 4b00aba42e4d9440d22e399ec2122fe8601bbe54) Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
* [3.12] gh-113841: fix possible undefined division by 0 in _Py_c_pow() ↵Miss Islington (bot)2024-12-023-1/+8
| | | | | | | | | | | | | | | (GH-127211) (GH-127216) (GH-127530) [3.13] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211) (GH-127216) Note, that transformed expression is not an equivalent for original one (1/exp(-x) != exp(x) in general for floating-point numbers). Though, the difference seems to be ~1ULP for good libm implementations. It's more interesting why division was used from beginning. Closest algorithm I've found (no error checks, of course;)) - it's Algorithm 190 from ACM: https://dl.acm.org/doi/10.1145/366663.366679. It uses subtraction in the exponent. (cherry picked from commit f7bb658124aba74be4c13f498bf46cfded710ef9) (cherry picked from commit f41d8d89e79d634895868656f50a0e16e339f9d6) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* [3.12] gh-126618: fix repr(itertools.count(sys.maxsize)) (GH-127048) (#127510)Sergey B Kirpichev2024-12-023-6/+28
| | | | | (cherry picked from commit 930ba0ce605eee9e3b992fa368b00a3f2b7dc4c1) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.12] gh-126699: allow AsyncIterator to be used as a base for Protocols ↵Miss Islington (bot)2024-12-023-1/+6
| | | | | | | | | (GH-126702) (#126761) gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702) (cherry picked from commit feb3e0b19cb03f06364a3f5e970f0861b8883d1c) Co-authored-by: Stephen Morton <github@tungol.org>
* [3.12] gh-101100: Fix Sphinx warnings about list methods (GH-127054) (#127512)Miss Islington (bot)2024-12-023-8/+7
| | | | Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
* [3.12] add missing gc_collect() calls in sqlite3 tests (GH-127446) (#127501)Miss Islington (bot)2024-12-021-0/+2
| | | | | | add missing gc_collect() calls in sqlite3 tests (GH-127446) (cherry picked from commit 2a373da7700cf928e0a5ce3998d19351a3565df4) Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
* [3.12] Docs: Miscellaneous corrections to simple statements in the language ↵Carol Willing2024-12-021-22/+11
| | | | | | | | | | | reference (GH-126720) (#126891) * Replace: The :keyword:`global` -> The :keyword:`global` statement Add :keyword: when it's needed * Replace repeated links with duoble backticks (cherry picked from commit 94a7a4e22fb8f567090514785c69e65298acca42) Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
* [3.12] gh-99880: document rounding mode for new-style formatting (GH-121481) ↵Miss Islington (bot)2024-12-021-0/+5
| | | | | | | | | | | | | | | | | (#126335) The CPython uses _Py_dg_dtoa(), which does rounding to nearest with half to even tie-breaking rule. If that functions is unavailable, PyOS_double_to_string() fallbacks to system snprintf(). Since CPython 3.12, build requirements include C11 compiler *and* support for IEEE 754 floating point numbers (Annex F). This means that FE_TONEAREST macro is available and, per default, printf-like functions should use same rounding mode as _Py_dg_dtoa(). (cherry picked from commit 7d7d56d8b1147a6b85e1c09d01b164df7c5c4942) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.12] Fix Unicode encode_wstr_utf8() (#127420) (#127504)Bénédikt Tran2024-12-021-1/+1
| | | | | | | Fix Unicode encode_wstr_utf8() (#127420) Raise RuntimeError instead of RuntimeWarning. Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451) ↵Miss Islington (bot)2024-12-021-19/+21
| | | | | | | | | | (#127497) gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451) Fix incorrect entries in `Doc/data/refcounts.dat` (cherry picked from commit 1f8267b85dda655282922ba20df90d0ac6bea634) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.12] gh-127356: Fix prepend doctrees directory for gettext target ↵Miss Islington (bot)2024-12-011-1/+1
| | | | | | (GH-127357) (#127471) Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
* [3.12] Docs: Fix incorrect indents in `c-api/type.rst` (GH-127449) (#127461)Yuki Kobayashi2024-12-011-20/+19
| | | (cherry picked from commit 33ce8dcf791721fea563715f681dc1593a35b83b)
* [3.12] Add the missing `f` on an f-string error message in multiprocessing. ↵Miss Islington (bot)2024-12-011-1/+1
| | | | | | | | (GH-127462) (#127465) Add the missing `f` on an f-string error message in multiprocessing. (GH-127462) (cherry picked from commit 11c01092d5fa8f02c867a7f1f3c135ce63db4838) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.12] Link to correct class methods in asyncio primitives docs (GH-127270) ↵Bénédikt Tran2024-11-301-3/+4
| | | | (#127438)
* [3.12] gh-88110: Clear concurrent.futures.thread._threads_queues after fork ↵Miss Islington (bot)2024-11-303-0/+22
| | | | | | | | | | | | to avoid joining parent process' threads (GH-126098) (GH-127164) Threads are gone after fork, so clear the queues too. Otherwise the child process (here created via multiprocessing.Process) crashes on interpreter exit. (cherry picked from commit 1848ce61f349533ae5892a8c24c2e0e3c364fc8a) Co-authored-by: Andrei Bodrov <Drino@users.noreply.github.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-127208: Reject null character in _imp.create_dynamic() (#127400) ↵Victor Stinner2024-11-294-3/+33
| | | | | | | | | | | | (#127419) gh-127208: Reject null character in _imp.create_dynamic() (#127400) _imp.create_dynamic() now rejects embedded null characters in the path and in the module name. Backport also the _PyUnicode_AsUTF8NoNUL() function. (cherry picked from commit b14fdadc6c620875a20b7ccc3c9b069e85d8557a)
* [3.12] gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (GH-127365) (#127394)Hugo van Kemenade2024-11-291-1/+4
|
* [3.12] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() ↵Miss Islington (bot)2024-11-291-1/+5
| | | | | | | | | | (GH-127358) (#127402) gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358) Replace the sleep(2) with a task which is blocked forever. (cherry picked from commit bfabf96b50b7d6a9c15b298a86ba3633b05a1fd7) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127391)Miss Islington (bot)2024-11-295-2/+13
| | | | | | | | | | | | gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) --------- (cherry picked from commit dd3a87d2a8f8750978359a99de2c5cb2168351d1) Co-authored-by: Илья Любавский <100635212+lubaskinc0de@users.noreply.github.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Tomas R. <tomas.roun8@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.12] gh-127190: Fix local_setattro() error handling (GH-127366) (#127368)Miss Islington (bot)2024-11-282-1/+16
| | | | | | | | | gh-127190: Fix local_setattro() error handling (GH-127366) Don't make the assumption that the 'name' argument is a string. Use repr() to format the 'name' argument instead. (cherry picked from commit 20657fbdb14d50ca4ec115da0cbef155871d8d33) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-123967: Fix faulthandler for trampoline frames (#127329) (#127363)Victor Stinner2024-11-282-9/+16
| | | | | | | gh-123967: Fix faulthandler for trampoline frames (#127329) If the top-most frame is a trampoline frame, skip it. (cherry picked from commit 58e334e1431b2ed6b70ee42501ea73e08084e769)
* [3.12] gh-124008: Fix calculation of the number of written bytes for the ↵Miss Islington (bot)2024-11-273-28/+115
| | | | | | | | | | | | | | | Windows console (GH-124059) (GH-127326) Since MultiByteToWideChar()/WideCharToMultiByte() is not reversible if the data contains invalid UTF-8 sequences, use binary search to calculate the number of written bytes from the number of written characters. Also fix writing incomplete UTF-8 sequences. Also fix handling of memory allocation failures. (cherry picked from commit 3cf83d91a5baf3600dd60f7aaaf4fb6d73c4b8a9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-109746: Fix race condition in test_start_new_thread_failed ↵Miss Islington (bot)2024-11-271-2/+2
| | | | | | | (GH-127299) (GH-127324) (cherry picked from commit 83926d3b4c7847394b5e2531e9566d7fc9fbea0f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-101100: Fix sphinx warnings in `howto/*` (GH-127084) (#127311)Yuki Kobayashi2024-11-273-106/+105
|
* [3.12] gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184) (GH-127252)Miss Islington (bot)2024-11-261-17/+115
| | | | | | | | | | | | | | | | gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184) * Make `create_shelllink_persist` top level function. * Add `CopyComPointerTests`. * Add more tests. * Update tests. * Add assertions for `Release`'s return value. (cherry picked from commit c7f1e3e150ca181f4b4bd1e5b59d492749f00be6) Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
* [3.12] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst ↵Miss Islington (bot)2024-11-251-1/+1
| | | | | | | (GH-127268) (cherry picked from commit 26ff32b30553e1f7b0cc822835ad2da8890c180c) Co-authored-by: funkyrailroad <funkyrailroad@users.noreply.github.com>
* [3.12] Fix a few typos found in the docs (GH-127126) (GH-127185)Rafael Fontenelle2024-11-253-4/+4
| | | (cherry picked from commit 39e60aeb3837f1f23d8b7f30d3b8d9faf805ef88)
* [3.12] gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the ↵Miss Islington (bot)2024-11-253-14/+33
| | | | | | | | | first value (GH-127219) (#127263) gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (GH-127219) (cherry picked from commit a2ee89968299fc4f0da4b5a4165025b941213ba5) Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-126384: Add tests to verify the behavior of basic COM methods. ↵Miss Islington (bot)2024-11-251-0/+188
| | | | | | | (GH-126610) (GH-127160) (cherry picked from commit 7725c0371a93be3ccfaff4871014a80bdf0ea274) Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
* [3.12] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127240)Yuki Kobayashi2024-11-254-12/+12
|
* [3.12] gh-127217: Fix pathname2url() for paths starting with multiple ↵Miss Islington (bot)2024-11-243-0/+9
| | | | | | | slashes on Posix (GH-127218) (GH-127231) (cherry picked from commit 97b2ceaaaf88a73a45254912a0e972412879ccbf) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] Improve `pathname2url()` and `url2pathname()` docs (GH-127125) (#127233)Miss Islington (bot)2024-11-241-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve `pathname2url()` and `url2pathname()` docs (GH-127125) These functions have long sown confusion among Python developers. The existing documentation says they deal with URL path components, but that doesn't fit the evidence on Windows: >>> pathname2url(r'C:\foo') '///C:/foo' >>> pathname2url(r'\\server\share') '////server/share' # or '//server/share' as of quite recently If these were URL path components, they would imply complete URLs like `file://///C:/foo` and `file://////server/share`. Clearly this isn't right. Yet the implementation in `nturl2path` is deliberate, and the `url2pathname()` function correctly inverts it. On non-Windows platforms, the behaviour until quite recently is to simply quote/unquote the path without adding or removing any leading slashes. This behaviour is compatible with *both* interpretations -- 1) the value is a URL path component (existing docs), and 2) the value is everything following `file:` (this commit) The conclusion I draw is that these functions operate on everything after the `file:` prefix, which may include an authority section. This is the only explanation that fits both the Windows and non-Windows behaviour. It's also a better match for the function names. (cherry picked from commit 307c63358681d669ae39e5ecd814bded4a93443a) Co-authored-by: Barney Gale <barney.gale@gmail.com>
* [3.12] Fix "useable" typo in docs (GH-127200) (#127206)Miss Islington (bot)2024-11-231-1/+1
| | | | | | | | Fix "useable" typo in docs (GH-127200) Fix typo in docs (cherry picked from commit dbd23790dbd662169905be6300259992639d4e69) Co-authored-by: Stan U <89152624+StanFromIreland@users.noreply.github.com>
* [3.12] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code ↵Miss Islington (bot)2024-11-231-1/+5
| | | | | | | | (GH-126667) (#127202) Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (cherry picked from commit e3038e976b25a58f512d8c7083a752c89436eb0d) Co-authored-by: Richard Hansen <rhansen@rhansen.org>
* [3.12] gh-109746: Make _thread.start_new_thread delete state of new thread ↵Serhiy Storchaka2024-11-224-1/+40
| | | | | | | | | | | | on its startup failure (GH-109761) (GH-127173) If Python fails to start newly created thread due to failure of underlying PyThread_start_new_thread() call, its state should be removed from interpreter' thread states list to avoid its double cleanup. (cherry picked from commit ca3ea9ad05c3d876a58463595e5b4228fda06936) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
* [3.12] gh-127001: Fix PATHEXT issues in shutil.which() on Windows ↵Serhiy Storchaka2024-11-224-246/+301
| | | | | | | | | | | (GH-127035) (GH-127158) * Name without a PATHEXT extension is only searched if the mode does not include X_OK. * Support multi-component PATHEXT extensions (e.g. ".foo.bar"). * Support files without extensions in PATHEXT contains dot-only extension (".", "..", etc). * Support PATHEXT extensions that end with a dot (e.g. ".foo."). (cherry picked from commit 8899e85de100557899da05f0b37867a371a73800)
* [3.12] GH-122679: Add `register()` to argparse docs (GH-126939) (GH-127148)Miss Islington (bot)2024-11-221-3/+33
| | | | | (cherry picked from commit fcfdb55465636afc256bc29781b283404d88e6ca) Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
* [3.12] gh-127082: Replace "Windows only" with the `availability: Windows` in ↵Jun Komoda2024-11-221-14/+45
| | | | | `ctypes` doc (GH-127099) (#127145) (cherry picked from commit 3c770e3f0978d825c5ebea98fcd654660e7e135f)
* [3.12] GH-127078: `url2pathname()`: handle extra slash before UNC drive in ↵Miss Islington (bot)2024-11-223-1/+6
| | | | | | | | | | | | URL path (GH-127132) (#127136) GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path (GH-127132) Decode a file URI like `file://///server/share` as a UNC path like `\\server\share`. This form of file URI is created by software the simply prepends `file:///` to any absolute Windows path. (cherry picked from commit 8c98ed846a7d7e50c4cf06f823d94737144dcf6a) Co-authored-by: Barney Gale <barney.gale@gmail.com>
* [3.12] GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) ↵Miss Islington (bot)2024-11-224-5/+15
| | | | | | | | | | | | (#127131) GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) Discard any 'localhost' authority from the beginning of a `file:` URI. As a result, file URIs like `//localhost/etc/hosts` are correctly decoded as `/etc/hosts`. (cherry picked from commit ebf564a1d3e2e81b9846535114e481d6096443d2) Co-authored-by: Barney Gale <barney.gale@gmail.com>
* [3.12] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127098)Serhiy Storchaka2024-11-214-28/+96
| | | | | It now returns multiple era description segments separated by semicolons. Previously it only returned the first segment on platforms with Glibc. (cherry picked from commit 4803cd0244847f286641c85591fda08b513cea52)
* [3.12] gh-126997: Fix support of non-ASCII strings in pickletools ↵Miss Islington (bot)2024-11-213-4/+92
| | | | | | | | | | (GH-127062) (GH-127095) * Fix support of STRING and GLOBAL opcodes with non-ASCII arguments. * dis() now outputs non-ASCII bytes in STRING, BINSTRING and SHORT_BINSTRING arguments as escaped (\xXX). (cherry picked from commit eaf217108226633c03cc5c4c90f0b6e4587c8803) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] Run `apt update` before `apt install git` in autoconf CI job (GH-127071)Miss Islington (bot)2024-11-201-1/+1
| | | | | (cherry picked from commit 0af4ec30bd2e3a52350344d1011c0c125d6dcd71) Co-authored-by: Zachary Ware <zach@python.org>
* [3.12] gh-126991: Add tests for unpickling bad object state (GH-127031) ↵Miss Islington (bot)2024-11-201-0/+35
| | | | | | | | (GH-127064) This catches a memory leak in loading the BUILD opcode. (cherry picked from commit addb225f3823b03774cddacce35214dd471bec46) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] GH-85168: Use filesystem encoding when converting to/from `file` URIs ↵Miss Islington (bot)2024-11-194-10/+26
| | | | | | | | | | | | | | | (GH-126852) (#127040) GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH-126852) Adjust `urllib.request.url2pathname()` and `pathname2url()` to use the filesystem encoding when quoting and unquoting file URIs, rather than forcing use of UTF-8. No changes are needed in the `nturl2path` module because Windows always uses UTF-8, per PEP 529. (cherry picked from commit c9b399fbdb01584dcfff0d7f6ad484644ff269c3) Co-authored-by: Barney Gale <barney.gale@gmail.com>
* [3.12] gh-126991: Fix reference leak in loading pickle's opcode BUILD ↵Miss Islington (bot)2024-11-191-0/+1
| | | | | | | | (GH-126990) (GH-127019) If PyObject_SetItem() fails in the `load_build()` function of _pickle.c, no DECREF for the `dict` variable. (cherry picked from commit 29cbcbd73bbfd8c953c0b213fb33682c289934ff) Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>