summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-46968: Fix invalid reference to Sound eXchange (SoX) 12.17.7 ↵Miss Islington (bot)2024-02-061-24/+22
| | | | | | | license (GH-115094) (GH-115095) (cherry picked from commit b39119916c0daaf5e5fdfec63e18ad97f29e2e72) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.11] gh-89811: Check for valid tp_version_tag in specializer (GH-115045)Peter Lazorchak2024-02-061-0/+29
| | | | | | | * gh-89811: Check for valid tp_version_tag in specializer (GH-113558) * gh-113937 Fix failures in type cache tests due to re-running (GH-113953) * Update backported code for 3.11 specifically
* [3.11] gh-115015: Argument Clinic: fix generated code for METH_METHOD ↵Erlend E. Aasland2024-02-0617-45/+112
| | | | | methods without params (#115016) (#115069) (cherry picked from commit 09096a1647913526a3d4fa69a9d2056ec82a8f37)
* gh-110190: Fix ctypes structs with array on Windows ARM64 (GH-114753)Miss Islington (bot)2024-01-311-1/+1
| | | | | (cherry picked from commit a06b606462740058b5d52fefdcdcd679d4f40260) Co-authored-by: Diego Russo <diego.russo@arm.com>
* Use Unicode unconditionally for _winapi.CreateFile (GH-114611)Steve Dower2024-01-262-13/+19
| | | Currently it switches based on build settings, but argument clinic does not handle it correctly.
* [3.11] gh-114492: Initialize struct termios before calling tcgetattr() ↵Miss Islington (bot)2024-01-231-0/+2
| | | | | | | | (GH-114495) (GH-114503) On Alpine Linux it could leave some field non-initialized. (cherry picked from commit d22c066b802592932f9eb18434782299e80ca42e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-104522: Fix OSError raised when run a subprocess (GH-114195) ↵Serhiy Storchaka2024-01-181-10/+11
| | | | | | | | | | | (GH-114243) Only set filename to cwd if it was caused by failed chdir(cwd). _fork_exec() now returns "noexec:chdir" for failed chdir(cwd). (cherry picked from commit e2c097ebdee447ded1109f99a235e65aa3533bf8) Co-authored-by: Robert O'Shea <PurityLake@users.noreply.github.com>
* [3.11] gh-111777: Fix assertion errors on incorrectly still-tracked GC ↵Miss Islington (bot)2024-01-171-1/+5
| | | | | | | | | | | | | | object destruction (GH-111778) (GH-111990) In PyObject_GC_Del, in Py_DEBUG mode, when warning about GC objects that were not properly untracked before starting destruction, take care to untrack the object _before_ warning, to avoid triggering a GC run and causing the problem the code tries to warn about. Also make sure to save and restore any pending exceptions, which the warning would otherwise clobber or trigger an assertion error on. (cherry picked from commit ce6a533c4bf1afa3775dfcaee5fc7d5c15a4af8c) Co-authored-by: T. Wouters <thomas@python.org>
* [3.11] gh-70835: Clarify error message for CSV file opened with wrong ↵Miss Islington (bot)2024-01-171-1/+2
| | | | | | | | newline (GH-113786) (GH-113906) Based on patch by SilentGhost. (cherry picked from commit 568d220993fa9b4b812ff1b425edd80dbe17dda9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-104282: Fix null pointer dereference in ↵Miss Islington (bot)2024-01-171-1/+3
| | | | | | | `lzma._decode_filter_properties` (GH-104283) (GH-114182) (cherry picked from commit 0154405350c272833bd51f68138223655e142a37) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
* gh-114096: Restore privileges in _winapi.CreateJunction after creating the ↵Steve Dower2024-01-161-9/+25
| | | | | junction (GH-114089) This avoids impact on later parts of the application which may be able to do things they otherwise shouldn't.
* gh-81489: Use Unicode APIs for mmap tagname on Windows (GH-14133)Steve Dower2024-01-111-23/+24
| | | | Co-authored-by: Zackery Spytz <zspytz@gmail.com> Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-87868: Sort and remove duplicates in getenvironment() (GH-102731)Miss Islington (bot)2024-01-111-5/+162
| | | | | | | | (cherry picked from commit c31be58da8577ef140e83d4e46502c7bb1eb9abf) Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-80109: Fix io.TextIOWrapper dropping the internal buffer during ↵Miss Islington (bot)2024-01-081-4/+8
| | | | | | | | | write() (GH-22535) (GH-113809) io.TextIOWrapper was dropping the internal decoding buffer during read() and write() calls. (cherry picked from commit 73c93265634257b1488262097e024c1727260cfd) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.11] gh-110190: Fix ctypes structs with array on PPCLE64 (GH-112959) (#113167)Diego Russo2024-01-052-59/+124
| | | | | | | Fix the same issue of PR #112604 on PPC64LE platform Refactor tests to make easier to add more platfroms if needed. (cherry picked from commit 6644ca45cde9ca1b80513a90dacccfeea2d98620) Change-Id: I1ada30808c0d593a43eca3fa7a628c26bc276310
* [3.11] gh-62260: Fix ctypes.Structure subclassing with multiple layers ↵Serhiy Storchaka2024-01-012-6/+6
| | | | | | | | | | | | | | | (GH-13374) (GH-113624) The length field of StgDictObject for Structure class contains now the total number of items in ffi_type_pointer.elements (excluding the trailing null). The old behavior of using the number of elements in the parent class can cause the array to be truncated when it is copied, especially when there are multiple layers of subclassing. (cherry picked from commit 5f3cc90a12d6df404fd6f48a0df1334902e271f2) Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
* [3.11] gh-113566: Fix asyncio segfault during interpreter finalization (#113578)Guido van Rossum2023-12-301-0/+3
|
* [3.11] bpo-11102: Make configure enable major(), makedev(), and minor() on ↵Miss Islington (bot)2023-12-281-4/+5
| | | | | | | | | | HP-UX (GH-19856) (GH-113541) Always include <sys/types.h> before <sys/sysmacros.h>. (cherry picked from commit f108468970bf4e70910862476900f924fb701399) Co-authored-by: Zackery Spytz <zspytz@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] bpo-37013: Fix the error handling in socket.if_indextoname() ↵Miss Islington (bot)2023-12-251-5/+11
| | | | | | | | | (GH-13503) (GH-112598) * Fix a crash when pass UINT_MAX. * Fix an integer overflow on 64-bit non-Windows platforms. (cherry picked from commit 0daf555c6fb3feba77989382135a58215e1d70a5) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.11] gh-110190: Fix ctypes structs with array on Arm (#112604) (#112766)Diego Russo2023-12-062-18/+71
| | | | | | | | | Set MAX_STRUCT_SIZE to 32 in stgdict.c when on Arm platforms. This because on Arm platforms structs with at most 4 elements of any floating point type values can be passed through registers. If the type is double the maximum size of the struct is 32 bytes. On x86-64 Linux, it's maximum 16 bytes hence we need to differentiate. (cherry picked from commit bc68f4a4abcfbea60bb1db1ccadb07613561931c)
* [3.11] gh-105967: Work around a macOS bug, limit zlib C library crc32 API ↵Miss Islington (bot)2023-12-042-10/+26
| | | | | | | | | | | | | | calls to 1gig (GH-112615) (#112725) gh-105967: Work around a macOS bug, limit zlib C library crc32 API calls to 1gig (GH-112615) Work around a macOS bug, limit zlib crc32 calls to 1GiB. Without this, `zlib.crc32` and `binascii.crc32` could produce incorrect results on multi-gigabyte inputs depending on the macOS version's Apple supplied zlib implementation. (cherry picked from commit 4eddb4c9d9452482c9af7fa9eec223d12b5a9f33) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.11] gh-109786: Fix leaks and crash when re-enter ↵Miss Islington (bot)2023-12-041-2/+11
| | | | | | | itertools.pairwise.__next__() (GH-109788) (GH-112700) (cherry picked from commit 6ca9d3e0173c38e2eac50367b187d4c1d43f9892) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-112678: Declare `Tkapp_CallDeallocArgs()` as `static` (GH-112679) ↵Miss Islington (bot)2023-12-041-1/+1
| | | | | | | (GH-112691) (cherry picked from commit 23e001fa9f1897ba3384c02bbbe634313358a549) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* [3.11] bpo-35191: Fix unexpected integer truncation in socket.setblocking() ↵Alexey Izbyshev2023-12-011-3/+5
| | | | | | | | | (GH-10415) On platforms with 64-bit long, socket.setblocking(x) treated all x which lower 32 bits are zero as False due to integer truncation. Reported by ubsan.
* [3.11] gh-112105: Make completer delims work on libedit (gh-112106) (gh-112488)Miss Islington (bot)2023-11-281-0/+16
| | | | | | gh-112105: Make completer delims work on libedit (gh-112106) (cherry picked from commit 2df26d83486b8f9ac6b7df2a9a4669508aa61983) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
* [3.11] bpo-41422: Visit the Pickler's and Unpickler's memo in tp_traverse ↵Serhiy Storchaka2023-11-271-0/+14
| | | | | | | (GH-21664) (GH-112465) (cherry picked from commit 967f2a3052c2d22e31564b428a9aa8cc63dc2a9f) Co-authored-by: kale-smoothie <34165060+kale-smoothie@users.noreply.github.com>
* [3.11] gh-111942: Fix crashes in TextIOWrapper.reconfigure() (GH-111976) ↵Miss Islington (bot)2023-11-151-4/+46
| | | | | | | | | | | | | (GH-112059) * Fix crash when encoding is not string or None. * Fix crash when both line_buffering and write_through raise exception when converted ti int. * Add a number of tests for constructor and reconfigure() method with invalid arguments. (cherry picked from commit ee06fffd38cb51ce1c045da9d8336d9ce13c318a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] Fix undefined behaviour in datetime.time.fromisoformat() (GH-111982) ↵Miss Islington (bot)2023-11-121-1/+1
| | | | | | | | | | (#111991) Fix undefined behaviour in datetime.time.fromisoformat() (GH-111982) Fix undefined behaviour in datetime.time.fromisoformat() when parsing a string without a timezone. 'tzoffset' is not assigned to by parse_isoformat_time if it returns 0, but time_fromisoformat then passes tzoffset to another function, which is undefined behaviour (even if the function in question does not use the value). (cherry picked from commit 21615f77b5a580e83589abae618dbe7c298700e2) Co-authored-by: T. Wouters <thomas@python.org>
* [3.11] gh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL on ↵Miss Islington (bot)2023-11-111-1/+6
| | | | | | | Windows (GH-111842) (GH-111967) (cherry picked from commit 0b06d2482d77e02c5d40e221f6046c9c355458b2) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-111251: Fix error checking in _blake2 module init (GH-111252) ↵Miss Islington (bot)2023-11-101-8/+17
| | | | | | | (#111298) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* [3.11] GH-111804: Drop posix.fallocate() under WASI (GH-111869) (GH-111920)Brett Cannon2023-11-092-5/+8
| | | | | | | | | GH-111804: Drop posix.fallocate() under WASI (GH-111869) Drop posix.fallocate() under WASI. The underlying POSIX function, posix_fallocate(), was found to vary too much between implementations to remain in WASI. As such, while it was available in WASI preview1, it's been dropped in preview2.
* [3.11] gh-101180: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 co… ↵Donghee Na2023-11-061-3/+6
| | | | | | | | (gh-111771) [3.11] gh-101180: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 codecs read out of bounds (gh-111695) (cherry picked from commit c8faa3568afd255708096f6aa8df0afa80cf7697) Co-authored-by: Masayuki Moriyama <masayuki.moriyama@miraclelinux.com>
* [3.11] gh-111174: Fix crash in getbuffer() called repeatedly for empty ↵Miss Islington (bot)2023-10-251-3/+4
| | | | | | | BytesIO (GH-111210) (GH-111315) (cherry picked from commit 9da98c0d9a7cc55c67fb0bd3fa162fd3b2c2629b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-110913: Fix WindowsConsoleIO chunking of UTF-8 text (GH-111007)Miss Islington (bot)2023-10-201-16/+20
| | | | | (cherry picked from commit 11312eae6ec3acf51aacafce4cb6d1a5edfd5f2e) Co-authored-by: Tamás Hegedűs <sorgloomer@users.noreply.github.com>
* [3.11] [3.12] bpo-42663: Fix parsing TZ strings in zoneinfo module ↵Serhiy Storchaka2023-10-151-219/+152
| | | | | | | | | | (GH-23825) (GH-110882) (GH-110889) zipinfo now supports the full range of values in the TZ string determined by RFC 8536 and detects all invalid formats. Both Python and C implementations now raise exceptions of the same type on invalid data. (cherry picked from commit ab08ff7882b6181fb785eed7410dbf8030aded70) (cherry picked from commit 72b0f0eaf52ac46d5f6e165f737d6f891cf8d172)
* [3.11] gh-109747: Improve errors for unsupported look-behind patterns ↵Miss Islington (bot)2023-10-142-9/+7
| | | | | | | | | | | (GH-109859) (GH-110860) Now re.error is raised instead of OverflowError or RuntimeError for too large width of look-behind pattern. The limit is increased to 2**32-1 (was 2**31-1). (cherry picked from commit e2b3d831fd2824d8a5713e3ed2a64aad0fb6b62d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-110590: Fix a bug where _sre.compile would overwrite exceptions ↵Miss Islington (bot)2023-10-101-0/+3
| | | | | | | | | (GH-110591) (#110614) TypeError would be overwritten by OverflowError if 'code' param contained non-ints. (cherry picked from commit 344d3a222a7864f8157773749bdd77d1c9dfc1e6) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-78469: Declare missing sethostname for Solaris 10 (GH-109447) ↵Miss Islington (bot)2023-10-101-2/+3
| | | | | | | | (#110581) Add OS version specific macro for Solaris: Py_SUNOS_VERSION. (cherry picked from commit 3b1580af07c0ce90d1c2073ab087772283d7e3b9) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
* [3.11] gh-109191: Fix build with newer editline (gh-110239) (#110575)Bo Anderson2023-10-091-1/+1
| | | (cherry picked from commit f4cb0d27cc08f490c42a22e646eb73cc7072d54a)
* [3.11] gh-110365: Fix error overwrite in `termios.tcsetattr` (GH-110366) ↵Miss Islington (bot)2023-10-051-13/+26
| | | | | | | | (#110390) (cherry picked from commit 2bbbab212fb10b3aeaded188fb5d6c001fb4bf74) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.11] gh-108851: Fix support.get_recursion_available() for USE_STACKCHECK ↵Victor Stinner2023-09-291-2/+8
| | | | | | | (#110127) Add _testcapi.USE_STACKCHECK. USE_STACKCHECK on using on Windows 32-bit.
* [3.11] gh-110052: Fix faulthandler for freed tstate (#110069) (#110072)Victor Stinner2023-09-291-2/+1
| | | | | | | | | | gh-110052: Fix faulthandler for freed tstate (#110069) faulthandler now detected freed interp and freed tstate, and no longer dereference them. Backport to 3.11: add pycore_pymem.h include to traceback.c. (cherry picked from commit 2e37a38bcbfbe1357436e030538290e7d00b668d)
* [3.11] gh-109098: Fuzz re module instead of internal sre (GH-109911) (GH-109933)Miss Islington (bot)2023-09-271-20/+16
| | | | | | | * Fix c-analyzer globals test failure * Put globals exception in ignored.tsv (cherry picked from commit a829356f86d597e4dfe92e236a6d711c8a464f16) Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* [3.11] gh-109593: Fix reentrancy issue in multiprocessing resource_tracker ↵Miss Islington (bot)2023-09-261-0/+14
| | | | | | | | | | | | (GH-109629) (#109897) gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (GH-109629) --------- (cherry picked from commit 0eb98837b60bc58e57ad3e2b35c6b0e9ab634678) Co-authored-by: Antoine Pitrou <antoine@python.org> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* [3.11] gh-109631: Allow interruption of short repeated regex matches ↵Miss Islington (bot)2023-09-262-2/+5
| | | | | | | | | (GH-109867) (GH-109885) Counting for signal checking now continues in new match from the point where it ended in the previous match instead of starting from 0. (cherry picked from commit 8ac2085b80eca4d9b2a1093d0a7da020fd12e11a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-109795: `_thread.start_new_thread`: allocate thread bootstate ↵Victor Stinner2023-09-251-3/+6
| | | | | | | | | usin… (#109852) gh-109795: `_thread.start_new_thread`: allocate thread bootstate using raw memory allocator (#109808) (cherry picked from commit 1b8f2366b38c87b0450d9c15bdfdd4c4a2fc3a01) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
* [3.11] gh-109613: _pystat_fromstructstat() checks for exceptions (#109618) ↵Victor Stinner2023-09-211-46/+67
| | | | | | | | | | | | | | | | | | | (#109668) gh-109613: _pystat_fromstructstat() checks for exceptions (#109618) Fix os.stat() and os.DirEntry.stat(): check for exceptions. Previously, on Python built in debug mode, these functions could trigger a fatal Python error (and abort the process) when a function succeeded with an exception set. _pystat_fromstructstat() now exits immediately if an exception is raised, rather only checking for exceptions at the end. It fix following fatal error in fill_time(): Fatal Python error: _Py_CheckSlotResult: Slot * of type int succeeded with an exception set (cherry picked from commit d4cea794a7b9b745817d2bd982d35412aef04710)
* [3.11] gh-108987: Fix _thread.start_new_thread() race condition (#109135) ↵Victor Stinner2023-09-111-16/+31
| | | | | | | | | | | | | | | | | | | (#109272) gh-108987: Fix _thread.start_new_thread() race condition (#109135) Fix _thread.start_new_thread() race condition. If a thread is created during Python finalization, the newly spawned thread now exits immediately instead of trying to access freed memory and lead to a crash. thread_run() calls PyEval_AcquireThread() which checks if the thread must exit. The problem was that tstate was dereferenced earlier in _PyThreadState_Bind() which leads to a crash most of the time. Move _PyThreadState_CheckConsistency() from thread_run() to _PyThreadState_Bind(). (cherry picked from commit 517cd82ea7d01b344804413ef05610934a43a241)
* [3.11] gh-104690: thread_run() checks for tstate dangling pointer (#109056) ↵Victor Stinner2023-09-081-2/+5
| | | | | | | | | | | | | | (#109134) gh-104690: thread_run() checks for tstate dangling pointer (#109056) thread_run() of _threadmodule.c now calls _PyThreadState_CheckConsistency() to check if tstate is a dangling pointer when Python is built in debug mode. Rename ceval_gil.c is_tstate_valid() to _PyThreadState_CheckConsistency() to reuse it in _threadmodule.c. (cherry picked from commit f63d37877ad166041489a968233b57540f8456e8)
* [3.11] gh-104372: Drop the GIL around the vfork() call. (#104782) (#104958)Gregory P. Smith2023-09-011-2/+19
| | | | | | | | | | | | | gh-104372: Drop the GIL around the vfork() call. (#104782) On Linux where the `subprocess` module can use the `vfork` syscall for faster spawning, prevent the parent process from blocking other threads by dropping the GIL while it waits for the vfork'ed child process `exec` outcome. This prevents spawning a binary from a slow filesystem from blocking the rest of the application. Fixes #104372. (cherry picked from commit d08679212d9af52dd074cd4a6abb440edb944c9c)