summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [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)
* [3.11] gh-107801: Improve the accuracy of io.IOBase.seek docs (#108268) ↵Erlend E. Aasland2023-08-291-7/+14
| | | | | | | | | | | (#108656) (cherry picked from commit 8178a88bd81edae87d6974483e4de9b32e808797) - Add param docstrings - Link to os.SEEK_* constants - Mention the return value in the initial paragraph Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* [3.11] gh-107801: Document io.TextIOWrapper.tell (#108265) (#108548)Erlend E. Aasland2023-08-272-3/+12
| | | (cherry picked from commit 38afa4af9bfc8297a5ee270c37f3f120a04297ea)
* [3.11] gh-107913: Fix possible losses of OSError error codes (GH-107930) ↵Serhiy Storchaka2023-08-2714-75/+122
| | | | | | | | (GH-108524) Functions like PyErr_SetFromErrno() and SetFromWindowsErr() should be called immediately after using the C API which sets errno or the Windows error code. (cherry picked from commit 2b15536fa94d07e9e286826c23507402313ec7f4)
* [3.11] Revert "gh-46376: Return existing pointer when possible in ctypes ↵Łukasz Langa2023-08-241-29/+0
| | | | | | | (GH-107131) (GH-107488)" (#108412) This reverts commit 57f27e444175a8a5ffcd86971e06de61c1c38628. The fix caused gh-107940. Until we have a bulletproof fix for that, the 3.11 backport needs to be reverted to make way for 3.11.5.
* [3.11] Trim trailing whitespace and test on CI (GH-104275) (#108215)Hugo van Kemenade2023-08-2216-109/+109
|
* [3.11] gh-102507 Remove invisible pagebreak characters (GH-102531) (#108266)Miss Islington (bot)2023-08-221-3/+0
| | | | | | | gh-102507 Remove invisible pagebreak characters (GH-102531) (cherry picked from commit b097925858c6975c73e989226cf278cc382c0416) Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com> Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
* [3.11] gh-107801: Improve the accuracy of io.TextIOWrapper.seek docs ↵Erlend E. Aasland2023-08-222-5/+39
| | | | | | | | | | | (#107933) (#108264) (cherry picked from commit 7f87ebbc3f52680c939791f397b9a478edf0c8d4) Clearly document the supported seek() operations: - Rewind to the start of the stream - Restore a previous stream position (given by tell()) - Fast-forward to the end of the stream
* [3.11] gh-107801: Improve the accuracy of os.lseek docs (#107935) (#108137)Erlend E. Aasland2023-08-192-8/+22
| | | | | | | | | | - name the last parameter *whence*, like it is for seek() methods on file objects - add param docstrings - structure the valid *whence* params (cherry picked from commit dd4442c8f597af1ec3eaf20f7ad89c4ac7e2dbc9) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* [3.11] gh-100061: Proper fix of the bug in the matching of possessive ↵Serhiy Storchaka2023-08-161-0/+4
| | | | | | | | | | | | quantifiers (GH-102612) (GH-108004) Restore the global Input Stream pointer after trying to match a sub-pattern. Co-authored-by: Ma Lin <animalize@users.noreply.github.com> (cherry picked from commit abd9cc52d94b8e2835322b62c29f09bb0e6fcfe9) Co-authored-by: SKO <41810398+uyw4687@users.noreply.github.com>
* [3.11] gh-106242: Fix path truncation in os.path.normpath (GH-106816) (#107982)Steve Dower2023-08-151-1/+3
| | | Co-authored-by: Finn Womack <flan313@gmail.com>
* [3.11] gh-106844: Fix issues in _winapi.LCMapStringEx (GH-107832) (GH-107875)Serhiy Storchaka2023-08-121-12/+14
| | | | | | | | | * Strings with length from 2**31-1 to 2**32-2 always caused MemoryError, it doesn't matter how much memory is available. * Strings with length exactly 2**32-1 caused OSError. * Strings longer than 2**32-1 characters were truncated due to integer overflow bug. Now strings longer than 2**31-1 characters caused OverflowError. (cherry picked from commit 04cc01453db2f0af72a06440831637f8bf512daf)
* [3.11] gh-107735: Add C API tests for PySys_GetObject() and ↵Serhiy Storchaka2023-08-071-0/+41
| | | | | PySys_SetObject() (GH-107736) (GH-107741) (cherry picked from commit bea5f93196d213d6fbf4ba8984caf4c3cd1da882)
* [3.11] gh-107077: Raise SSLCertVerificationError even if the error is set ↵Miss Islington (bot)2023-08-031-0/+4
| | | | | | | via SSL_ERROR_SYSCALL (GH-107586) (#107588) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: T. Wouters <thomas@python.org>
* [3.11] gh-106263: Fix segfault in `signaldict_repr` in `_decimal` module ↵Charlie Zhao2023-07-311-3/+27
| | | | | | | (#… (#107490) Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com> (cherry picked from commit 3979150a0d406707f6d253d7c15fb32c1e005a77)
* [3.11] gh-46376: Return existing pointer when possible in ctypes (GH-107131) ↵Łukasz Langa2023-07-311-0/+29
| | | | | | | (#107488) (cherry picked from commit 08447b5deb47e2a0df87fa0a0576d300e5c909b4) Co-authored-by: Konstantin <kpp.live+github@gmail.com>
* [3.11] gh-106881: Check for linux/limits.h before including it (#107397) ↵justdan62023-07-281-1/+1
| | | | | | | | | | | | (#107415) * [3.11] gh-106881: Check for linux/limits.h before including it (#107397) * Check for linux/limits.h before including it Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> (cherry picked from commit 11c055f5ff1a353de6d2e77f2af24aaa782878ba) * Fix sphinx-lint error in NEWS entry
* [3.11] gh-104432: Use `memcpy()` to avoid misaligned loads (GH-104433) (#107356)Miss Islington (bot)2023-07-282-7/+25
| | | | | | | | | | gh-104432: Use `memcpy()` to avoid misaligned loads (GH-104433) Fix potential unaligned memory access on C APIs involving returned sequences of `char *` pointers within the :mod:`grp` and :mod:`socket` modules. These were revealed using a ``-fsaniziter=alignment`` build on ARM macOS. (cherry picked from commit f01e4cedba1a17d321664834bb255d9d04ad16ce) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* [3.11] gh-106350: Tkinter: do not ignore return value of `mp_init()` ↵Miss Islington (bot)2023-07-261-2/+3
| | | | | | | (GH-106351) (GH-107259) (cherry picked from commit b5ae7c498438657a6ba0bf4cc216b9c2c93a06c7) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* [3.11] gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data ↵Serhiy Storchaka2023-07-251-1/+36
| | | | | | | (GH-99613) (GH-107224) Previously *consumed was not set in this case. (cherry picked from commit f08e52ccb027f6f703302b8c1a82db9fd3934270)
* [3.11] gh-86493: Fix possible leaks in some modules initialization ↵Serhiy Storchaka2023-07-198-43/+34
| | | | | | | | | (GH-106768) (GH-106855) (GH-106863) [3.11] [3.12] gh-86493: Fix possible leaks in some modules initialization (GH-106768) (GH-106855) Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time. (cherry picked from commit 3e65baee72131b49f4ce8ca2da568a6f2001ce93). (cherry picked from commit a423ddbdeada8a2fd8657453b9e9f58ba0dd921d)
* [3.11] gh-86493: Fix possible leaks in modules initialization: ↵Serhiy Storchaka2023-07-184-84/+43
| | | | | | | _curses_panel, _decimal, posix, xxsubtype (GH-106767) (GH-106849) (GH-106851) (cherry picked from commit 745492355b94d109e47827e5865846f25ae42d26) (cherry picked from commit 970cb8eabaaf5a8311f1aba4ca4968ef7385fce8)