summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-123431: Harmonize extension code checks in pickle (GH-123434) ↵Miss Islington (bot)2024-09-061-16/+8
| | | | | | | | | | | (#123460) This checks are redundant in normal circumstances and can only work if the extension registry was intentionally broken. (cherry picked from commit 0c3ea3023878f5ad5ca4680d5510da1fe208cbfa) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment ↵Miss Islington (bot)2024-09-061-10/+2
| | | | | | to no longer hide exceptions (GH-123214) (#123258) Co-authored-by: Bar Harel <bharel@barharel.com>
* [3.12] gh-111495: Add tests for PyNumber C API (GH-111996) (#123376)Sergey B Kirpichev2024-09-051-0/+161
| | | (cherry picked from commit 2f20f5a9bc7dafdb3c2ae723da90eca1727a95f7)
* [3.12] gh-111495: Add tests for PyTuple C API (GH-118757) (#123379)Sergey B Kirpichev2024-09-051-1/+227
| | | | | | | (cherry picked from commit dbc1752d4107532d312c78263212e807a3674eb1) Co-authored-by: kalyanr <kalyan.ben10@live.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-123678: Upgrade libexpat 2.6.3 (GH-123689) (GH-123708)Miss Islington (bot)2024-09-043-15/+35
| | | | | | | | gh-123678: Upgrade libexpat 2.6.3 (GH-123689) Upgrade libexpat 2.6.3 (cherry picked from commit 40bdb0deee746e51c71c56329df21e5172fd8aa0) Co-authored-by: Seth Michael Larson <seth@python.org>
* [3.12] gh-112182: Replace StopIteration with RuntimeError for future ↵Miss Islington (bot)2024-08-151-5/+20
| | | | | | | | | | | (GH-113220) (GH-123033) When an `StopIteration` raises into `asyncio.Future`, this will cause a thread to hang. This commit address this by not raising an exception and silently transforming the `StopIteration` with a `RuntimeError`, which the caller can reconstruct from `fut.exception().__cause__` (cherry picked from commit 4826d52338396758b2d6790a498c2a06eec19a86) Co-authored-by: Jamie Phan <jamie@ordinarylab.dev>
* [3.12] gh-113785: csv: fields starting with escapechar are not quoted ↵Miss Islington (bot)2024-08-091-0/+2
| | | | | | | (GH-122110) (GH-122259) (cherry picked from commit a3327dbfd4db9e5ad1ca514963d503abbbbfede7) Co-authored-by: Mikołaj Kuranowski <mkuranowski@gmail.com>
* [3.12] gh-122695: Fix double-free when using `gc.get_referents` with a freed ↵Victor Stinner2024-08-091-8/+0
| | | | | | | | | | | `_asyncio.FutureIter` (#122837) (#122859) [3.13] gh-122695: Fix double-free when using `gc.get_referents` with a freed `_asyncio.FutureIter` (#122837) * Backport #122834 for 3.13 (cherry picked from commit e8fb088dbaa71dd5f0146b2f4a8f7ecbe2ce9625) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.12] gh-118814: Fix the TypeVar constructor when name is passed by keyword ↵Serhiy Storchaka2024-08-082-1/+93
| | | | | | | | (GH-122664) (GH-122807) Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for positional-or-keyword parameter is passed by keyword. There was only one such case in the stdlib -- the TypeVar constructor. (cherry picked from commit 540fcc62f5da982b79504221cac01bfab8b73ba1)
* gh-100256: Skip inaccessible registry keys in the WinAPI mimetype ↵Miss Islington (bot)2024-08-071-1/+1
| | | | | | | implementation (GH-122047) (cherry picked from commit 0bd93755f37e6b8beb597787fce39eb141179965) Co-authored-by: Lucas Esposito <LucasEsposito@users.noreply.github.com>
* [3.12] gh-119577: Adjust DeprecationWarning when testing element truth ↵Gregory P. Smith2024-08-061-1/+1
| | | | | | | | | | | | | values in Element tree (GH-119762) (#120190) gh-119577: Adjust DeprecationWarning when testing element truth values in ElementTree (GH-119762) Adjust DeprecationWarning when testing element truth values in ElementTree, we're planning to go with the more natural True return rather than a disruptive harder to code around exception raise, and are deferring the behavior change for a few more releases. Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* [3.12] gh-122311: Fix a refleak in pickle (GH-122411) (GH-122416)Miss Islington (bot)2024-07-291-0/+1
| | | | | (cherry picked from commit 68840e91ac6689d3954b98a9ab136e194b5250b8) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Revert "[3.12] gh-120713: Normalize year with century for datetime.strftime ↵Serhiy Storchaka2024-07-291-50/+4
| | | | | (GH-120820) (GH-121145)" (GH-122409) This reverts commit 027902b56f2176c571e5e244c3c23dc7247b67dc.
* [3.12] gh-122311: Fix some error messages in pickle (GH-122386) (GH-122388)Miss Islington (bot)2024-07-291-3/+3
| | | | | (cherry picked from commit 3b034d26eb8480f8d12ae11f42d038d24cf8498a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-122332: Fix missing `NULL` check in `asyncio.Task.get_coro` ↵Miss Islington (bot)2024-07-271-1/+5
| | | | | | | | (GH-122338) (#122345) gh-122332: Fix missing `NULL` check in `asyncio.Task.get_coro` (GH-122338) (cherry picked from commit c08696286f52d286674f264eecf7b33a335a890b) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.12] gh-82951: Fix serializing by name in pickle protocols < 4 (GH-122149) ↵Miss Islington (bot)2024-07-251-17/+36
| | | | | | | | | | (GH-122265) Serializing objects with complex __qualname__ (such as unbound methods and nested classes) by name no longer involves serializing parent objects by value in pickle protocols < 4. (cherry picked from commit dc07f65a53baf60d9857186294d3d7ba92d5606d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-121957: Emit audit events for python -i and python -m asyncio ↵Łukasz Langa2024-07-221-0/+4
| | | | (GH-122117)
* [3.12] gh-121905: Consistently use "floating-point" instead of "floating ↵Serhiy Storchaka2024-07-1914-37/+37
| | | | | point" (GH-121907) (GH-122013) (cherry picked from commit 1a0c7b9ba48a2dffb70bb0c7327abae1d3e87356)
* [3.12] gh-120289: Add external timer in traverse of _lsprof.Profiler ↵Miss Islington (bot)2024-07-191-0/+1
| | | | | | | | (GH-121998) (#122001) gh-120289: Add external timer in traverse of _lsprof.Profiler (GH-121998) (cherry picked from commit eaf094c09b5b1c33435c60ef49b1cec78c32573c) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
* [3.12] gh-120289: Disallow disable() and clear() in external timer to ↵Miss Islington (bot)2024-07-181-1/+19
| | | | | | | | prevent use-after-free (GH-120297) (#121989) gh-120289: Disallow disable() and clear() in external timer to prevent use-after-free (GH-120297) (cherry picked from commit 1ab17782832bb1b6baa915627aead3e3516a0894) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
* [3.12] gh-121791: Check for `NULL` in `MethodDescriptor2_new` in `_testcapi` ↵Miss Islington (bot)2024-07-161-0/+3
| | | | | | | | (GH-121792) (#121840) gh-121791: Check for `NULL` in `MethodDescriptor2_new` in `_testcapi` (GH-121792) (cherry picked from commit 8b6d4755812d0b02e9f26beb9c9a7714e4c5ac28) Co-authored-by: sobolevn <mail@sobolevn.me>
* [3.12] gh-120713: Normalize year with century for datetime.strftime ↵Serhiy Storchaka2024-06-291-4/+50
| | | | | | | (GH-120820) (GH-121145) (cherry picked from commit 6d34938dc8163f4a4bcc68069a1645a7ab76e935) Co-authored-by: blhsing <blhsing@gmail.com>
* [3.12] gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of ↵Miss Islington (bot)2024-06-281-0/+2
| | | | | | | | | | _pickle.c (GH-121136) (#121140) gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (GH-121136) PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added (cherry picked from commit 92893fd8dc803ed7cdde55d29d25f84ccb5e3ef0) Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
* [3.12] gh-119614: Fix truncation of strings with embedded null characters in ↵Miss Islington (bot)2024-06-241-7/+33
| | | | | | | | | Tkinter (GH-120909) (GH-120939) Now the null character is always represented as \xc0\x80 for Tcl_NewStringObj(). (cherry picked from commit c38e2f64d012929168dfef7363c9e48bd1a6c731) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-101830: Fix Tcl_Obj to string conversion (GH-120884) (GH-120913)Serhiy Storchaka2024-06-231-21/+25
| | | | | Accessing the Tkinter object's string representation no longer converts the underlying Tcl object to a string on Windows. (cherry picked from commit f4ddaa396715855ffbd94590f89ab7d55feeec07)
* [3.12] gh-119506: fix `_io.TextIOWrapper.write()` write during flush ↵Miss Islington (bot)2024-06-191-9/+22
| | | | | | | | | (GH-119507) (#119965) gh-119506: fix `_io.TextIOWrapper.write()` write during flush (GH-119507) (cherry picked from commit 52586f930f62bd80374f0f240a4ecce0c0238174) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com> Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* [3.12] gh-120586: Fix several "unused function" warnings in `posixmodule.c` ↵Miss Islington (bot)2024-06-171-1/+3
| | | | | | | | (GH-120588) (#120617) gh-120586: Fix several "unused function" warnings in `posixmodule.c` (GH-120588) (cherry picked from commit 3df2022931f77c5cadb3f51b371be6ae17587ede) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-71587: Drop local reference cache to `_strptime` module in ↵neonene2024-06-131-7/+7
| | | | | | | `_datetime` (gh-120431) The _strptime module object was cached in a static local variable (in the datetime.strptime() implementation). That's a problem when it crosses isolation boundaries, such as reinitializing the runtme or between interpreters. This change fixes the problem by dropping the static variable, instead always relying on the normal sys.modules cache (via PyImport_Import()). (cherry picked from commit 127c1d2771749853e287632c086b6054212bf12a, AKA gh-120224)
* [3.12] gh-120155: Add assertion to sre.c match_getindex() (GH-120402) (#120410)Miss Islington (bot)2024-06-121-0/+2
| | | | | | | | | gh-120155: Add assertion to sre.c match_getindex() (GH-120402) Add an assertion to help static analyzers to detect that i*2 cannot overflow. (cherry picked from commit 42b25dd61ff3593795c4cc2ffe876ab766098b24) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-120155: Fix Coverity issue in zoneinfo load_data() (GH-120232) ↵Miss Islington (bot)2024-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | (#120311) gh-120155: Fix Coverity issue in zoneinfo load_data() (GH-120232) Declare the 'rv' varaible at the top of the load_data() function to make sure that it's initialized before the first 'goto error' which uses 'rv' (return rv). Fix the Coverity issue: Error: UNINIT (CWE-457): Python-3.12.2/Modules/_zoneinfo.c:1233:5: skipped_decl: Jumping over declaration of ""rv"". Python-3.12.2/Modules/_zoneinfo.c:1284:5: uninit_use: Using uninitialized value ""rv"". 1282| } 1283| 1284|-> return rv; 1285| } 1286| (cherry picked from commit b90bd3e5bbc136f53b24ee791824acd6b17e0d42) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-120244: Fix re.sub() reference leak (GH-120245) (GH-120265)Miss Islington (bot)2024-06-081-0/+1
| | | | | (cherry picked from commit 38a25e9560cf0ff0b80d9e90bce793ff24c6e027) Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
* [3.12] gh-112672: Fix builtin Tkinter with Tcl 9.0 (GH-112681) (GH-120209)Miss Islington (bot)2024-06-071-14/+24
| | | | | | | | | * Add declaration of Tcl_AppInit(), missing in Tcl 9.0. * Use Tcl_Size instead of int where needed. (cherry picked from commit e0799352823289fafb8131341abd751923ee9c08) Co-authored-by: Christopher Chavez <chrischavez@gmx.us> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-89928: Fix integer conversion of device numbers (GH-31794) (GH-120054)Serhiy Storchaka2024-06-042-37/+83
| | | | | | Fix os.major(), os.minor() and os.makedev(). Support device numbers larger than 2**63-1. Support non-existent device number (NODEV). (cherry picked from commit 7111d9605f9db7aa0b095bb8ece7ccc0b8115c3f)
* [3.12] Revert "[3.12] gh-69214: Fix fcntl.ioctl() request type (#119498) ↵Victor Stinner2024-06-012-9/+8
| | | | | | | | | | (#1… (#119905) Revert "[3.12] gh-69214: Fix fcntl.ioctl() request type (#119498) (#119505)" This reverts commit 078da88ad19e8f7474b6943edd39b7e61511bd20. The change modified how negative values, like termios.TIOCSWINSZ, was treated and is actually backward incompatible.
* [3.12] gh-119585: Fix crash involving `PyGILState_Release()` and ↵Sam Gross2024-05-311-0/+9
| | | | | | | | | | | `PyThreadState_Clear()` (GH-119753) (#119861) Make sure that `gilstate_counter` is not zero in when calling `PyThreadState_Clear()`. A destructor called from `PyThreadState_Clear()` may call back into `PyGILState_Ensure()` and `PyGILState_Release()`. If `gilstate_counter` is zero, it will try to create a new thread state before the current active thread state is destroyed, leading to an assertion failure or crash. (cherry picked from commit bcc1be39cb1d04ad9fc0bd1b9193d3972835a57c)
* [3.12] gh-103194: Fix Tkinter’s Tcl value type handling for Tcl 8.7/9.0 ↵Serhiy Storchaka2024-05-311-22/+32
| | | | | | | | | | | (GH-103846) (GH-119831) Some of standard Tcl types were renamed, removed, or no longer registered in Tcl 8.7/9.0. This change fixes automatic conversion of Tcl values to Python values to avoid returning a Tcl_Obj where the primary Python types (int, bool, str, bytes) were returned in older Tcl. (cherry picked from commit 94e9585e99abc2d060cedc77b3c03e06b4a0a9c4) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* gh-119690: Adds Unicode support for named pipes in _winapi (GH-119717)Steve Dower2024-05-302-26/+31
| | | Also backports a minor improvement to test_audit.
* gh-118263: Add additional arguments to path_t (Argument Clinic type) in ↵Nice Zombies2024-05-282-248/+299
| | | | posixmodule (GH-119608)
* [3.12] gh-69214: Fix fcntl.ioctl() request type (#119498) (#119505)Victor Stinner2024-05-242-8/+9
| | | | | | | | gh-69214: Fix fcntl.ioctl() request type (#119498) Use an 'unsigned long' instead of an 'unsigned int' for the request parameter of fcntl.ioctl() to support requests larger than UINT_MAX. (cherry picked from commit 92fab3356f4c61d4c73606e4fae705c6d8f6213b)
* [3.12] gh-119213: Be More Careful About _PyArg_Parser.kwtuple Across ↵Eric Snow2024-05-222-1/+80
| | | | | | | | | | | Interpreters (gh-119331) (gh-119425) _PyArg_Parser holds static global data generated for modules by Argument Clinic. The _PyArg_Parser.kwtuple field is a tuple object, even though it's stored within a static global. In some cases the tuple is statically allocated and thus it's okay that it gets shared by multiple interpreters. However, in other cases the tuple is set lazily, allocated from the heap using the active interprepreter at the point the tuple is needed. This is a problem once that interpreter is destroyed since _PyArg_Parser.kwtuple becomes at dangling pointer, leading to crashes. It isn't a problem if the tuple is allocated under the main interpreter, since its lifetime is bound to the lifetime of the runtime. The solution here is to temporarily switch to the main interpreter. The alternative would be to always statically allocate the tuple. This change also fixes a bug where only the most recent parser was added to the global linked list. (cherry picked from commit 81865002aee8eaaeb3c7e402f86183afa6de77bf)
* gh-118507 : Refactor ntpath native functions (gh-119381)Nice Zombies2024-05-222-379/+309
| | | | This refactoring will make future backports easier without changing behaviours, apart from correcting a bug when passing a pipe to `ntpath.isfile`.
* gh-118486: Simplify test_win32_mkdir_700 to check the exact ACL (GH-119056)Miss Islington (bot)2024-05-151-1/+1
| | | | | (cherry picked from commit 94591dca510c796c7d40e9b4167ea56f2fdf28ca) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.12] gh-118998: Handle errors correctly in `tmtotuple` in `timemodule` ↵Miss Islington (bot)2024-05-131-10/+17
| | | | | | | | (GH-118999) (#119019) gh-118998: Handle errors correctly in `tmtotuple` in `timemodule` (GH-118999) (cherry picked from commit fc757925944a9486d4244853dbe6e37ab3e560c2) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-118486: Support mkdir(mode=0o700) on Windows (GH-118488)Steve Dower2024-05-091-2/+37
|
* [3.12] gh-118671: Updated dead ActiveState links (GH-118730) (#118754)Miss Islington (bot)2024-05-081-1/+1
| | | | | | Co-authored-by: trag1c <trag1cdev@yahoo.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* [3.12] gh-118314: Fix padding edge case in binascii.a2b_base64 strict mode ↵Miss Islington (bot)2024-05-071-0/+7
| | | | | | | | | | | | | | (GH-118320) (GH-118691) gh-118314: Fix padding edge case in binascii.a2b_base64 strict mode (GH-118320) Fix an edge case in `binascii.a2b_base64` strict mode, where excessive padding was not detected when no padding is necessary. (cherry picked from commit fe47d9bee319528ffeb5fd60a615d7f02c7b5585) Co-authored-by: Youfu Zhang <1315097+zhangyoufu@users.noreply.github.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
* [3.12] gh-71592: Add ability to trace Tcl commands executed by Tkinter ↵Serhiy Storchaka2024-05-062-2/+176
| | | | | | | | | | | | | | | | | (GH-118291) (GH-118662) This is an experimental feature, for internal use. Setting tkinter._debug = True before creating the root window enables printing every executed Tcl command (or a Tcl command equivalent to the used Tcl C API). This will help to convert a Tkinter example into Tcl script to check whether the issue is caused by Tkinter or exists in the underlying Tcl/Tk library. (cherry picked from commit 1ff626ebda465931ff3e4922e8e87d586eb6244c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-117968: Make the test for closed file more safe in the C API tests ↵Miss Islington (bot)2024-04-251-2/+4
| | | | | | | | | | | (GH-118230) (GH-118266) The behavior of fileno() after fclose() is undefined, but it is the only practical way to check whether the file was closed. Only test this on the known platforms (Linux, Windows, macOS), where we already tested that it works. (cherry picked from commit 546cbcfa0eeeb533950bd49e30423f3d3bbd5ebe) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-116741: Upgrade libexpat to 2.6.2 (GH-117296) (GH-118166)Miss Islington (bot)2024-04-233-16/+36
| | | | | | | | gh-116741: Upgrade libexpat to 2.6.2 (GH-117296) Upgrade libexpat to 2.6.2 (cherry picked from commit c9829eec0883a8991ea4d319d965e123a3cf6c20) Co-authored-by: Seth Michael Larson <seth@python.org>
* [3.12] gh-117968: Add tests for the part of the PyRun family of the C API ↵Serhiy Storchaka2024-04-224-1/+128
| | | | | | | | (GH-117982) (GH-118011) (cherry picked from commit 6078f2033ea15a16cf52fe8d644a95a3be72d2e3) Co-authored-by: NGRsoftlab <78017794+NGRsoftlab@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>