summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* gh-59703: restore include of mach-o/dyld.h (gh-112309)Ned Deily2023-11-221-0/+1
| | | | On older versions of macOS, _NSGetExecutablePath appears to only be available via macho-o/dyld so macho-o/dyld.h is still needed.
* gh-111863: Rename term Py_NOGIL to Py_GIL_DISABLED in sysconfig (gh-112307)Donghee Na2023-11-221-3/+3
|
* gh-59703: use the system dladdr function in getpath.c for macOS framework ↵AN Long2023-11-211-11/+6
| | | | | builds (GH-111546) Co-authored-by: Ned Deily <nad@python.org>
* gh-111863: Rename `Py_NOGIL` to `Py_GIL_DISABLED` (#111864)Hugo van Kemenade2023-11-2016-31/+31
| | | Rename Py_NOGIL to Py_GIL_DISABLED
* gh-111965: Using critical sections to make ``io.StringIO`` thread safe. ↵AN Long2023-11-192-30/+194
| | | | (gh-112116)
* gh-112213: Update _weakref module to use new AC feature (gh-112250)Donghee Na2023-11-192-25/+31
|
* gh-111903: Update AC to support "pycore_critical_section.h" header (gh-112251)Donghee Na2023-11-196-6/+6
|
* gh-111965: Use critical sections to make io.TextIOWrapper thread safe ↵AN Long2023-11-182-39/+181
| | | | (gh-112193)
* gh-111926: Update _weakref to be threadsafe in --disable-gil build (gh-112189)Donghee Na2023-11-181-9/+20
|
* gh-112070: make `functools.lru_cache` threadsafe in --disable-gil build ↵Wanderxjtu2023-11-172-6/+25
| | | | | | | | | | | | | | | | | (gh-112111) * gh-112070: make `functools.lrucacle` threadsafe in --disable-gil build * gh-112070: update generate `functoolsmodule` files * gh-112070: add NEWS file * Delete Misc/NEWS.d/next/Library/2023-11-15-20-19-45.gh-issue-112070.q6OhcU.rst * gh-112070: reformat functoolsmodule.c --------- Co-authored-by: Sam Gross <colesbury@gmail.com>
* gh-111482: Fix time_clockid_converter() on AIX (#112170)Victor Stinner2023-11-161-2/+2
| | | clockid_t is defined as long long on AIX.
* gh-111956: Add thread-safe one-time initialization. (gh-111960)Sam Gross2023-11-161-0/+32
|
* gh-111798: Use lower Py_C_RECURSION_LIMIT in debug mode (#112124)Victor Stinner2023-11-161-0/+9
| | | | | | | * Run again test_ast_recursion_limit() on WASI platform. * Add _testinternalcapi.get_c_recursion_remaining(). * Fix test_ast and test_sys_settrace: test_ast_recursion_limit() and test_trace_unpack_long_sequence() now adjust the maximum recursion depth depending on the the remaining C recursion.
* gh-111916: Make hashlib related modules thread-safe without the GIL (#111981)Tomas R2023-11-159-137/+187
| | | | | Always use an individual lock on hash objects when in free-threaded builds. Fixes #111916
* gh-96954: Fix `make regen-unicodedata` in out-of-tree builds (#112118)Miro Hrončok2023-11-152-2/+2
| | | | | | | | | This avoids: python3.13 Tools/unicode/makeunicodedata.py python3.13: can't open file '.../build/debug/Tools/unicode/makeunicodedata.py': [Errno 2] No such file or directory make: *** [Makefile:1498: regen-unicodedata] Error 2 Re-run `make regen-unicodedata` to update the script path in generated files.
* gh-111789: Use PyDict_GetItemRef() in Modules/_asynciomodule.c (GH-112072)Serhiy Storchaka2023-11-151-6/+2
|
* gh-112062: Make `_struct` module thread-safe in `--disable-gil` builds (#112094)Radislav Chugunov2023-11-151-7/+6
| | | | | * gh-112062: Make `_struct` module thread-safe in --disable-gil builds
* gh-111545: Test PyHash_GetFuncDef() function (#112098)Victor Stinner2023-11-154-1/+61
| | | Add Modules/_testcapi/hash.c and Lib/test/test_capi/test_hash.py.
* gh-111995: Add getnameinfo extension flag (#111994)adder322023-11-151-0/+3
| | | Add getnameinfo extension NI_IDN flag.
* gh-111942: Fix SystemError in the TextIOWrapper constructor (#112061)Serhiy Storchaka2023-11-141-2/+6
| | | | | | In non-debug more the check for the "errors" argument is skipped, and then PyUnicode_AsUTF8() can fail, but its result was not checked. Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-111942: Fix crashes in TextIOWrapper.reconfigure() (GH-111976)Serhiy Storchaka2023-11-141-3/+36
| | | | | | | | * 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.
* gh-111262: Add PyDict_Pop() function (#112028)Victor Stinner2023-11-144-27/+105
| | | | | | | _PyDict_Pop_KnownHash(): remove the default value and the return type becomes an int. Co-authored-by: Stefan Behnel <stefan_ml@behnel.de> Co-authored-by: Antoine Pitrou <pitrou@free.fr>
* gh-111903: Add `@critical_section` directive to Argument Clinic. (#111904)Sam Gross2023-11-142-3/+11
| | | | | | | | | The `@critical_section` directive instructs Argument Clinic to generate calls to `Py_BEGIN_CRITICAL_SECTION()` and `Py_END_CRITICAL_SECTION()` around the bound function. In `--disable-gil` builds, these calls will lock and unlock the `self` object. They are no-ops in the default build. This is used in one place (`_io._Buffered.close`) as a demonstration. Subsequent PRs will use it more widely in the `_io.Buffered` bindings.
* gh-111789: Use PyDict_GetItemRef() in _ctypes (GH-111828)Serhiy Storchaka2023-11-142-78/+61
|
* gh-107149: make new opcode util functions private rather than public and ↵Irit Katriel2023-11-141-17/+18
| | | | unstable (#112042)
* gh-111138: Add PyList_Extend() and PyList_Clear() functions (#111862)Victor Stinner2023-11-131-0/+21
| | | | | | * Split list_extend() into two sub-functions: list_extend_fast() and list_extend_iter(). * list_inplace_concat() no longer has to call Py_DECREF() on the list_extend() result, since list_extend() now returns an int.
* gh-111928: make "memo" dict local to scan_once call (gh-112005)AN Long2023-11-131-23/+19
| | | Co-authored-by: Sam Gross <colesbury@gmail.com>
* gh-111777: Fix assertion errors on incorrectly still-tracked GC object ↵T. Wouters2023-11-121-1/+3
| | | | | | | | | | destruction (#111778) 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.
* Fix undefined behaviour in datetime.time.fromisoformat() (#111982)T. Wouters2023-11-111-1/+1
| | | 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).
* gh-111789: Simplify the sqlite code (GH-111829)Serhiy Storchaka2023-11-102-17/+6
| | | | Use new C API functions PyDict_GetItemRef() and PyMapping_GetOptionalItemString().
* Add private _PyUnicode_AsUTF8NoNUL() function (GH-111957)Serhiy Storchaka2023-11-102-13/+2
| | | | Like PyUnicode_AsUTF8(), but check for embedded null characters.
* gh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL on Windows ↵Serhiy Storchaka2023-11-101-1/+6
| | | | (GH-111842)
* gh-111569: Fix critical sections test on WebAssembly (GH-111897)Sam Gross2023-11-091-0/+4
| | | | | | | | This adds a macro `Py_CAN_START_THREADS` that corresponds to the Python function `test.support.threading_helper.can_start_thread()`. WASI and some Emscripten builds do not have a working pthread implementation. This macro is used to guard the critical sections C API tests that require a working threads implementation.
* gh-111835: Add seekable method to mmap.mmap (gh-111852)Donghee Na2023-11-091-7/+14
|
* GH-111804: Drop posix.fallocate() under WASI (GH-111869)Brett Cannon2023-11-092-5/+8
| | | | | | | 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.
* gh-111569: Implement Python critical section API (gh-111571)Sam Gross2023-11-084-1/+218
| | | | | | | | Critical sections are helpers to replace the global interpreter lock with finer grained locking. They provide similar guarantees to the GIL and avoid the deadlock risk that plain locking involves. Critical sections are implicitly ended whenever the GIL would be released. They are resumed when the GIL would be acquired. Nested critical sections behave as if the sections were interleaved.
* Remove redundant check in dbm.open() (GH-111844)Serhiy Storchaka2023-11-081-5/+0
| | | PyUnicode_FSConverter() already checks for embedded null characters.
* gh-111495: Add tests for PyList C API (#111562)Kalyan2023-11-081-1/+179
| | | | | Signed-off-by: kalyanr <kalyan.ben10@live.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* socket: Update generated AC code (#111853)Jelle Zijlstra2023-11-081-2/+7
|
* gh-111662: Update socket module to use AC for optimizing performance (gh-111661)Bogdan Romanyuk2023-11-082-69/+223
|
* gh-111089: Revert PyUnicode_AsUTF8() changes (#111833)Victor Stinner2023-11-0727-154/+789
| | | | | | | | | | | | | | | | | | | | | * Revert "gh-111089: Use PyUnicode_AsUTF8() in Argument Clinic (#111585)" This reverts commit d9b606b3d04fc56fb0bcc479d7d6c14562edb5e2. * Revert "gh-111089: Use PyUnicode_AsUTF8() in getargs.c (#111620)" This reverts commit cde1071b2a72e8261ca66053ef61431b7f3a81fd. * Revert "gh-111089: PyUnicode_AsUTF8() now raises on embedded NUL (#111091)" This reverts commit d731579bfb9a497cfb0076cb6b221058a20088fe. * Revert "gh-111089: Add PyUnicode_AsUTF8() to the limited C API (#111121)" This reverts commit d8f32be5b6a736dc2fc9dca3f1bf176c82fc9b44. * Revert "gh-111089: Use PyUnicode_AsUTF8() in sqlite3 (#111122)" This reverts commit 37e4e20eaa8f27ada926d49e5971fecf0477ad26.
* gh-101180: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 codecs read out ↵Masayuki Moriyama2023-11-061-3/+6
| | | | of bounds (gh-111695)
* gh-111495: Add tests for PyComplex C API (GH-111591)Sergey B Kirpichev2023-11-051-0/+92
|
* gh-111495: Add tests for PyFloat C API (GH-111624)Sergey B Kirpichev2023-11-051-0/+74
|
* gh-110395: invalidate open kqueues after fork (#110517)Davide Rizzo2023-11-041-7/+137
| | | Invalidate open select.kqueue instances after fork as the fd will be invalid in the child.
* gh-96954: use a directed acyclic word graph for storing the unicodedata ↵CF Bolz-Tereick2023-11-042-30225/+17432
| | | | | | | codepoint names (#97906) Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com> Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* GH-110829: Ensure Thread.join() joins the OS thread (#110848)Antoine Pitrou2023-11-041-55/+282
| | | | | | | Joining a thread now ensures the underlying OS thread has exited. This is required for safer fork() in multi-threaded processes. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* Add a fuzz target for `_elementtree.XMLParser._parse_whole` (#111477)Brad Larsen2023-11-0359-0/+620
| | | * Add a fuzzer for `_elementtree.XMLParser._parse_whole`
* gh-90026: support XATTRs on Cygwin (GH-105075)Philippe Cerfon2023-11-031-3/+9
|
* gh-108082: Remove _PyErr_WriteUnraisableMsg() (GH-111643)Serhiy Storchaka2023-11-035-78/+16
| | | | Replace the remaining calls with PyErr_FormatUnraisable().