summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-104282: Fix null pointer dereference in `lzma._decode_filter_properties` ↵Radislav Chugunov2024-01-171-1/+3
| | | | (GH-104283)
* gh-114096: Restore privileges in _winapi.CreateJunction after creating the ↵Steve Dower2024-01-161-7/+21
| | | | | junction (GH-114089) This avoids impact on later parts of the application which may be able to do things they otherwise shouldn't.
* Fix an incorrect comment in iobase_is_closed (GH-102952)Jonathon Reinhart2024-01-161-10/+9
| | | | | | | | This comment appears to have been mistakenly copied from what is now called iobase_check_closed() in commit 4d9aec022063. Also unite the iobase_check_closed() code with the relevant comment. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-114101: Correct PyErr_Format arguments in _testcapi module (#114102)AN Long2024-01-162-8/+8
| | | | - use PyErr_SetString() iso. PyErr_Format() in parse_tuple_and_keywords() - fix misspelled format specifier in CHECK_SIGNNESS() macro
* gh-78502: Add a trackfd parameter to mmap.mmap() (GH-25425)Zackery Spytz2024-01-161-6/+20
| | | | | | | | If *trackfd* is False, the file descriptor specified by *fileno* will not be duplicated. Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-113666: Adding missing UF_ and SF_ flags to module 'stat' (#113667)Ronald Oussoren2024-01-151-3/+68
| | | | | Add some constants to module 'stat' that are used on macOS. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-113868: Add a number of MAP_* flags from macOS to module mmap (#113869)Ronald Oussoren2024-01-121-0/+33
| | | | | The new flags were extracted from the macOS 14.2 SDK. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-111877: Fixes stat() handling for inaccessible files on Windows (GH-113716)Steve Dower2024-01-121-6/+10
|
* gh-81489: Use Unicode APIs for mmap tagname on Windows (GH-14133)Zackery Spytz2024-01-111-19/+15
| | | Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-89811: Check for valid tp_version_tag in specializer (GH-113558)Peter Lazorchak2024-01-111-0/+29
|
* gh-77046: os.pipe() sets _O_NOINHERIT flag on fds (#113817)Victor Stinner2024-01-102-4/+4
| | | | | | | | On Windows, set _O_NOINHERIT flag on file descriptors created by os.pipe() and io.WindowsConsoleIO. Add test_pipe_spawnl() to test_os. Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* gh-111139: Optimize math.gcd(int, int) (#113887)Victor Stinner2024-01-101-5/+9
| | | | | | | | | | | | | Add a fast-path for the common case. Benchmark: python -m pyperf timeit \ -s 'import math; gcd=math.gcd; x=2*3; y=3*5' \ 'gcd(x,y)' Result: 1.07x faster (-3.4 ns) Mean +- std dev: 52.6 ns +- 4.0 ns -> 49.2 ns +- 0.4 ns: 1.07x faster
* gh-111789: Use PyDict_GetItemRef() in Modules/_zoneinfo.c (GH-112078)Serhiy Storchaka2024-01-101-14/+5
|
* gh-89850: Add default C implementations of persistent_id() and ↵Serhiy Storchaka2024-01-102-211/+151
| | | | | | | | | | | persistent_load() (GH-113579) Previously the C implementation of pickle.Pickler and pickle.Unpickler classes did not have such methods and they could only be used if they were overloaded in subclasses or set as instance attributes. Fixed calling super().persistent_id() and super().persistent_load() in subclasses of the C implementation of pickle.Pickler and pickle.Unpickler classes. It no longer causes an infinite recursion.
* gh-70835: Clarify error message for CSV file opened with wrong newline ↵Serhiy Storchaka2024-01-101-1/+2
| | | | | (GH-113786) Based on patch by SilentGhost.
* gh-112182: Replace StopIteration with RuntimeError for future (#113220)Jamie Phan2024-01-101-5/+20
| | | | | | 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__`
* gh-66060: Use actual class name in _io type's __repr__ (#30824)AN Long2024-01-093-20/+29
| | | | | | Use the object's actual class name in the following _io type's __repr__: - FileIO - TextIOWrapper - _WindowsConsoleIO
* gh-113848: Use PyErr_GivenExceptionMatches() for check for CancelledError ↵Serhiy Storchaka2024-01-091-15/+1
| | | | (GH-113849)
* gh-87868: Sort and remove duplicates in getenvironment() (GH-102731)AN Long2024-01-091-4/+155
| | | | | 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>
* gh-113791: Expose CLOCK_MONOTONIC_RAW_APPROX and CLOCK_UPTIME_RAW_APROX on ↵Ronald Oussoren2024-01-081-6/+10
| | | | | | | macOS in the time module (#113792)
* gh-113755: Fully adapt gcmodule.c to Argument Clinic (#113756)Erlend E. Aasland2024-01-082-27/+174
| | | | | | | Adapt the following functions to Argument Clinic: - gc.set_threshold - gc.get_referrers - gc.get_referents
* gh-113787: Fix refleaks in test_capi (gh-113816)neonene2024-01-082-3/+2
| | | Fix refleaks and a typo.
* gh-110721: Remove unused code from suggestions.c after moving PyErr_Display ↵Pablo Galindo Salgado2024-01-083-0/+105
| | | | to use the traceback module (#113712)
* gh-80109: Fix io.TextIOWrapper dropping the internal buffer during write() ↵Zackery Spytz2024-01-081-4/+8
| | | | | | | (GH-22535) io.TextIOWrapper was dropping the internal decoding buffer during read() and write() calls.
* gh-89532: Remove LibreSSL workarounds (#28728)Rami2024-01-062-6326/+3
| | | | | | Remove LibreSSL specific workaround ifdefs from `_ssl.c` and delete the non-version-specific `_ssl_data.h` file (relevant for OpenSSL < 1.1.1, which we no longer support per PEP 644). Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-113750: Fix object resurrection in free-threaded builds (gh-113751)Sam Gross2024-01-061-3/+1
| | | | | | | | | gh-113750: Fix object resurrection on free-threaded builds This avoids the undesired re-initializing of fields like `ob_gc_bits`, `ob_mutex`, and `ob_tid` when an object is resurrected due to its finalizer being called. This change has no effect on the default (with GIL) build.
* gh-113688: Split up gcmodule.c (gh-113715)Sam Gross2024-01-051-1959/+32
| | | | | This splits part of Modules/gcmodule.c of into Python/gc.c, which now contains the core garbage collection implementation. The Python module remain in the Modules/gcmodule.c file.
* gh-111178: Avoid calling functions from incompatible pointer types in ↵Christopher Chavez2024-01-021-18/+26
| | | | | _tkinter.c (GH-112893) Fix undefined behavior warnings (UBSan -fsanitize=function).
* GH-113633: Use module state structure for _testcapi. (GH-113634)Neil Schemenauer2024-01-011-51/+64
| | | Use module state structure for _testcapi.
* gh-113536: Expose `os.waitid` on macOS (#113542)Ronald Oussoren2024-01-012-10/+10
| | | | | | | | | * gh-113536: Expose `os.waitid` on macOS This API has been available on macOS for a long time, but was explicitly excluded due to unspecified problems with the API in ancient versions of macOS. * Document that the API is available on macOS starting in Python 3.13
* gh-62260: Fix ctypes.Structure subclassing with multiple layers (GH-13374)Jeffrey Kintscher2024-01-012-6/+6
| | | | | | | | | | | 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. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-103092: Make ``pyexpat`` module importable in sub-interpreters (#113555)Kirill Podoprigora2023-12-291-3/+1
|
* bpo-11102: Make configure enable major(), makedev(), and minor() on HP-UX ↵Zackery Spytz2023-12-281-4/+5
| | | | | | | (GH-19856) Always include <sys/types.h> before <sys/sysmacros.h>. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-103092: Make `_elementtree` module importable in sub-interpreters (#113434)Kirill Podoprigora2023-12-281-3/+1
| | | Enable imports of _elementtree module in sub-interpreters
* gh-113332: Simplify calls to SSL_(CTX_)set_verify in _ssl.c (#113333)David Benjamin2023-12-261-7/+2
| | | | _ssl.c currently tries to preserve the verification callback, but at no point does it ever set one. Just pass in NULL.
* gh-113191: Add support of os.fchmod() on Windows (GH-113192)Serhiy Storchaka2023-12-242-27/+59
| | | | Also support a file descriptor in os.chmod().
* gh-111784: Fix two segfaults in the elementtree module (GH-113405)Kirill Podoprigora2023-12-241-2/+14
| | | | | | | | | | First fix resolve situation when pyexpat module (which contains expat_CAPI capsule) deallocates before _elementtree, so we need to hold a strong reference to pyexpat module to. Second fix resolve situation when module state is deallocated before deallocation of XMLParser instances, which uses module state to clear some stuff.
* gh-112205: Support docstring for `@getter` (#113160)Donghee Na2023-12-204-49/+204
| | | | | --------- Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-113119: Fix the macOS framework installer build (#113268)Gregory P. Smith2023-12-191-1/+10
| | | `--enable-framework` builds were failing. we apparently do not have good CI & buildbot coverage here.
* gh-113039: Avoid using leading dots in the include path for frozen ↵Itamar Oren2023-12-181-1/+1
| | | | getpath.py (GH-113022)
* gh-113117: Support posix_spawn in subprocess.Popen with close_fds=True (#113118)Jakub Kulík2023-12-171-0/+24
| | | | | | | | Add support for `os.POSIX_SPAWN_CLOSEFROM` and `posix_spawn_file_actions_addclosefrom_np` and have the `subprocess` module use them when available. This means `posix_spawn` can now be used in the default `close_fds=True` situation on many platforms. Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
* gh-113149: Improve error message when JSON has trailing comma (GH-113227)Carson Radtke2023-12-171-0/+14
|
* gh-113119 fix environment handling in subprocess.Popen when posix_spawn is ↵Jakub Kulík2023-12-171-6/+10
| | | | | | | used (#113120) * Allow posix_spawn to inherit environment form parent environ variable. With this change, posix_spawn call can behave similarly to execv with regards to environments when used in subprocess functions.
* gh-113202: Add a strict option to itertools.batched() (gh-113203)Raymond Hettinger2023-12-162-21/+40
|
* gh-111964: Add _PyRWMutex a "readers-writer" lock (gh-112859)Sam Gross2023-12-161-0/+99
| | | | This adds `_PyRWMutex`, a "readers-writer" lock, which wil be used to serialize global stop-the-world pauses with per-interpreter pauses.
* gh-113172: Fix compiler warnings in Modules/_xxinterpqueuesmodule.c (GH-113173)Serhiy Storchaka2023-12-151-1/+3
| | | Fix compiler waarnings in Modules/_xxinterpqueuesmodule.c
* bpo-36796: Clean the error handling in _testcapimodule.c (GH-13085)Zackery Spytz2023-12-142-14/+50
|
* gh-86179: Avoid making case-only changes when calculating realpath() during ↵Steve Dower2023-12-141-2/+11
| | | | initialization (GH-113077)
* gh-59616: Support os.chmod(follow_symlinks=True) and os.lchmod() on Windows ↵Serhiy Storchaka2023-12-142-23/+71
| | | | (GH-113049)
* gh-112205: Update textio module to use `@getter` as possible. (gh-113095)Donghee Na2023-12-142-49/+125
|