summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-98724: Fix Py_CLEAR() macro side effects (#99100) (#99288)Victor Stinner2022-11-091-0/+87
| | | | | | | | | The Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros now only evaluate their argument once. If an argument has side effects, these side effects are no longer duplicated. Add test_py_clear() and test_py_setref() unit tests to _testcapi. (cherry picked from commit c03e05c2e72f3ea5e797389e7d1042eef85ad37a)
* gh-92119: ctypes: Print exception class name instead of its representation ↵Miss Islington (bot)2022-11-081-1/+4
| | | | | | | (GH-98302) (cherry picked from commit b9dedfe61dce2997e3e6be318d8c50b0c19c9394) Co-authored-by: Kamil Turek <kamil.turek@hotmail.com>
* gh-96055: Update faulthandler to emit proper unexpect signal number (gh-99162)Miss Islington (bot)2022-11-071-4/+16
| | | | | (cherry picked from commit f626b7b504df454d289527a4f922b09deeae9e21) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* gh-83004: Clean up refleak in _pickle initialisation (GH-98841)Miss Islington (bot)2022-11-061-7/+6
| | | | | (cherry picked from commit d3b82b4463c4eb51954c0afd98342f0c5e479baa) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-83004: Clean up refleak in _zoneinfo initialisation (GH-98842)Miss Islington (bot)2022-11-061-2/+3
| | | | | (cherry picked from commit 31f2f6568d89564cc1d686cd6b75ba5578aaa748) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-83004: Clean up refleak in _io initialisation (GH-98840)Miss Islington (bot)2022-11-061-3/+3
| | | | | (cherry picked from commit 1208037246eeab4c5c003f1651edfefb045e6fb7) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-94808: add tests covering `PySequence_{Set,Del}Slice` (GH-99123)Miss Islington (bot)2022-11-051-0/+33
| | | | | (cherry picked from commit c5c40773cbadc8c35212877ea315a375f3bfaa4b) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-94808: add tests covering `PyEval_GetFuncDesc` function (GH-98300)Miss Islington (bot)2022-11-051-0/+7
| | | | | (cherry picked from commit b5f711185bd11819566068ddf2a74a1402340e2d) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-98740: Fix validation of conditional expressions in RE (GH-98764)Miss Islington (bot)2022-11-031-27/+29
| | | | | | | | | | | | | | In very rare circumstances the JUMP opcode could be confused with the argument of the opcode in the "then" part which doesn't end with the JUMP opcode. This led to incorrect detection of the final JUMP opcode and incorrect calculation of the size of the subexpression. NOTE: Changed return value of functions _validate_inner() and _validate_charset() in Modules/_sre/sre.c. Now they return 0 on success, -1 on failure, and 1 if the last op is JUMP (which usually is a failure). Previously they returned 1 on success and 0 on failure. (cherry picked from commit e9ac890c0273aee413aa528cc202c3efa29f1d7a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-98790: When DLLs directory is missing on Windows, assume executable_dir ↵Steve Dower2022-11-021-7/+21
| | | | contains PYD files instead (GH-98936)
* GH-98897: fix memory leak if `math.dist` raises exception (GH-98898)Miss Islington (bot)2022-11-011-3/+3
| | | | | (cherry picked from commit ab575050709e2b313ca9a9585f09b6f4b0560318) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] gh-98793: Fix typecheck in `overlapped.c` (GH-98835) (#98889)Charlie Zhao2022-10-312-9/+9
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> (cherry picked from commit 3ac8c0ab6ee819a14b1c8e0992acbaf376a46058)
* gh-98739: Update libexpat from 2.4.9 to 2.5.0 (GH-98742)Miss Islington (bot)2022-10-273-18/+35
| | | | | | | | * Update libexpat from 2.4.9 to 2.5.0 to address CVE-2022-43680. Co-authored-by: Shaun Walbridge <shaun.walbridge@gmail.com> (cherry picked from commit 3e07f827b359617664ad0880f218f17ae4483299) Co-authored-by: Shaun Walbridge <46331011+scdub@users.noreply.github.com>
* Fix readline.c compiler warning. (GH-98738)Miss Islington (bot)2022-10-261-1/+1
| | | | | | | | | | ``` Modules/readline.c:1260:37: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] completer_word_break_characters = ^ ``` (cherry picked from commit 29b391b1378577825a658b14764a8ff3e0b5c958) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* gh-94808: cover `PyMapping_HasKeyString` and `PyMapping_HasKey` (GH-98486)Miss Islington (bot)2022-10-261-0/+36
| | | | | (cherry picked from commit 5d30544485dc56ab999ad7656ef6559306fd013f) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* bpo-2716: add license for audioop module (GH-19972)Miss Islington (bot)2022-10-211-14/+30
| | | | | (cherry picked from commit 4c1145bb3796c550d477c8c154ff980d566fe4a2) Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
* [3.11] gh-94808: Cover `PyFunction_GetCode`, `PyFunction_GetGlobals`,… ↵Jelle Zijlstra2022-10-191-0/+40
| | | | | | | | | (#98317) [3.11] gh-94808: Cover `PyFunction_GetCode`, `PyFunction_GetGlobals`, `PyFunction_GetModule` (GH-98158). (cherry picked from commit 7b48d02933639c91ebd957b2326d8c352d8eddec) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-94808: Cover `PyEval_GetFuncName` (GH-98246). (#98283)Jelle Zijlstra2022-10-151-0/+7
| | | | | (cherry picked from commit f01b56c7bdec239abe0dae2706f8325f4336249c) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-98178: syslog() is not thread-safe on macOS (GH-98213)Miss Islington (bot)2022-10-131-0/+5
| | | | | | | | | On macOS, fix a crash in syslog.syslog() in multi-threaded applications. On macOS, the libc syslog() function is not thread-safe, so syslog.syslog() no longer releases the GIL to call it. (cherry picked from commit d4b91663857e85eab1f309cacec4d27b5f6657ec) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.11] Add more syslog tests (GH-97953). (GH-98096)Serhiy Storchaka2022-10-081-1/+1
| | | | (cherry picked from commit cae7d1d7a713f8267daf5e4f2fff5cb1dad02c7c)
* [3.11] gh-96288: Add a sentence to `os.mkdir`'s docstring. (GH-96271). (#98065)Jelle Zijlstra2022-10-082-4/+6
| | | | | (cherry picked from commit 1523c9e9d47e7d67e4889987ff0f38eb7b881fdd) Co-authored-by: Hagai Helman Tov <hagai.helman@gmail.com>
* gh-65496: Correct wording on csv's skipinitialspace argument (GH-96170)Miss Islington (bot)2022-10-071-4/+4
| | | | | (cherry picked from commit 676d8ef3806758bcd1d3fd84a746c8a9b64480d0) Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
* fixes gh-96078: os.sched_yield release the GIL while calling sched_yield(2). ↵Miss Islington (bot)2022-10-071-1/+6
| | | | | | | (gh-97965) (cherry picked from commit b9d2e8171696514e9226164005f7bf24bf69e66d) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* GH-90985: Revert "Deprecate passing a message into cancel()" (GH-97999)Miss Islington (bot)2022-10-071-20/+0
| | | | | | | Reason: we were too hasty in deprecating this. We shouldn't deprecate it before we have a replacement. (cherry picked from commit 09de8d7aafece264720afbca3052a63eee413b73) Co-authored-by: Guido van Rossum <guido@python.org>
* [3.11] gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK ↵Miss Islington (bot)2022-10-061-8/+52
| | | | | | | | | | | | | (GH-97944) (#97969) The macOS 13 SDK includes support for the `mkfifoat` and `mknodat` system calls. Using the `dir_fd` option with either `os.mkfifo` or `os.mknod` could result in a segfault if cpython is built with the macOS 13 SDK but run on an earlier version of macOS. Prevent this by adding runtime support for detection of these system calls ("weaklinking") as is done for other newer syscalls on macOS. (cherry picked from commit 6d0a0191a4e5477bd843e62c24d7f3bcad4fd5fc) Co-authored-by: Ned Deily <nad@python.org>
* gh-97758: Fix a crash in getpath_joinpath() called without arguments (GH-97759)Miss Islington (bot)2022-10-051-1/+1
| | | | | (cherry picked from commit f8cbd79d328d90443acabc41d246332c302c815a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-97728: Argument Clinic: Fix uninitialized variable in the ↵Serhiy Storchaka2022-10-033-12/+12
| | | | | | | | Py_UNICODE converter (GH-97729) (GH-97757) It affects function os.system() on Windows and Windows-specific modules winreg, _winapi, _overlapped, and _msi. (cherry picked from commit 0ee9619a4cba58730c45e65d22288fadbf7680de)
* GH-97592: Fix crash in C remove_done_callback due to evil code (GH-97660)Miss Islington (bot)2022-09-301-2/+7
| | | | | | Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called. (cherry picked from commit 63780f4599acc2c5ee8af5f37ab76c162ad21065) Co-authored-by: Guido van Rossum <guido@python.org>
* gh-94526: getpath_dirname() no longer encodes the path (GH-97645)Miss Islington (bot)2022-09-301-9/+14
| | | | | | | | | | | | | | Fix the Python path configuration used to initialized sys.path at Python startup. Paths are no longer encoded to UTF-8/strict to avoid encoding errors if it contains surrogate characters (bytes paths are decoded with the surrogateescape error handler). getpath_basename() and getpath_dirname() functions no longer encode the path to UTF-8/strict, but work directly on Unicode strings. These functions now use PyUnicode_FindChar() and PyUnicode_Substring() on the Unicode path, rather than strrchr() on the encoded bytes string. (cherry picked from commit 9f2f1dd131b912e224cd0269adde8879799686c4) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-97005: Update libexpat from 2.4.7 to 2.4.9 (gh-97006)Miss Islington (bot)2022-09-227-17/+27
| | | | | | Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org> (cherry picked from commit 10e3d398c31cc1695752fc52bc6ca2ce9ef6237e) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* gh-96821: Fix undefined behaviour in `_testcapimodule.c` (GH-96915) (GH-96927)Miss Islington (bot)2022-09-191-1/+3
| | | | | | | | | | * gh-96821: Assert for demonstrating undefined behaviour * Fix UB (cherry picked from commit cbdeda8ce7a3543cb3376d70e4cd46fcf24f42a7) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Matthias Görgens <matthias.goergens@gmail.com>
* [3.11] gh-96005: Handle WASI ENOTCAPABLE in getpath (GH-96006) (GH-96034) ↵Christian Heimes2022-09-132-3/+7
| | | | | | | | (GH-96038) - On WASI `ENOTCAPABLE` is now mapped to `PermissionError`. - The `errno` modules exposes the new error number. - `getpath.py` now ignores `PermissionError` when it cannot open landmark files `pybuilddir.txt` and `pyenv.cfg`.
* GH-96754: Check whether the interpreter frame is complete before creating ↵Miss Islington (bot)2022-09-131-0/+3
| | | | | | | | | frame object. (GH-96776) (#96787) (cherry picked from commit 12c5f328d2479ac3432df5e266adc4e59adeabfe) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.11] gh-95853: Add script to automate WASM build (GH-95828, GH-95985, ↵Christian Heimes2022-09-131-1/+1
| | | | | | | | | | | | GH-96045, GH-96389, GH-96744) (GH-96749) Automate WASM build with a new Python script. The script provides several build profiles with configure flags for Emscripten flavors and WASI. The script can detect and use Emscripten SDK and WASI SDK from default locations or env vars. ``configure`` now detects Node arguments and creates HOSTRUNNER arguments for Node 16. It also sets correct arguments for ``wasm64-emscripten``.
* gh-96652: Fix faulthandler chained signal without sigaction() (GH-96666)Miss Islington (bot)2022-09-081-1/+1
| | | | | | | | Fix the faulthandler implementation of faulthandler.register(signal, chain=True) if the sigaction() function is not available: don't call the previous signal handler if it's NULL. (cherry picked from commit c580a81af91af4b9df85e466f8b48c3c9c86c3df) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-96641: Do not expose `KeyWrapper` in `_functoolsmodule.c` (gh-96642)Miss Islington (bot)2022-09-071-3/+2
| | | | | (cherry picked from commit 2fd7246e97c8cc09b4e3f22933693f9d68f08163) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] GH-96612: Skip incomplete frames in tracemalloc traces. (GH-96613) ↵Mark Shannon2022-09-061-3/+8
| | | | | | | (#96617) (cherry picked from commit 95e271b2266b8f2e7b60ede86ccf3ede4a7f83eb) Co-authored-by: Mark Shannon <mark@hotpy.org>
* fixes gh-96292: Fix Trivial Typo in cpython/Modules/atexitmodule.c (GH-96327)Miss Islington (bot)2022-08-271-1/+1
| | | | | (cherry picked from commit 0ace820bec8892d621a4aadc1feb6c56e25560bf) Co-authored-by: Ansab Gillani <56605828+ansabgillani@users.noreply.github.com>
* gh-95808: Add missing early returns in _asynciomodule.c (GH-95809)Miss Islington (bot)2022-08-161-2/+3
| | | | | (cherry picked from commit b2afe482f21b826d53886a69ea2c99d0d940c59a) Co-authored-by: Yury Selivanov <yury@edgedb.com>
* gh-95878: Fix format char in datetime CAPI tests (GH-95879) (#95885)Miss Islington (bot)2022-08-111-4/+4
| | | | | | | (cherry picked from commit 8b34e914bba2ccd6ae39609410db49d0beb19cb1) Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Christian Heimes <christian@python.org>
* [3.11] gh-92678: Correct return values for errors in PyInit__testcapi (#95664)Pablo Galindo Salgado2022-08-041-2/+2
|
* gh-91323: Revert "Allow overriding a future compliance check in asyncio.Task ↵Miss Islington (bot)2022-08-042-102/+8
| | | | | | | | (GH-32197)" (GH-95442) (GH-95652) This reverts commit d4bb38f82bf18b00db3129031ce4969b6f0caab9. (cherry picked from commit 0342c93a6b866118c894c4e1120fb4db316adebb) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-94936: C getters: co_varnames, co_cellvars, co_freevars (GH-95008)Miss Islington (bot)2022-08-041-11/+69
| | | | | (cherry picked from commit 42b102bbf9a9ae6fae8f6710202fb7afeeac277c) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* gh-91838: Resolve HTTP links which redirect to HTTPS (GH-95642)Miss Islington (bot)2022-08-041-1/+1
| | | | | | | It updates links which redirect to HTTPS with different authority or path. (cherry picked from commit d0d0154443cafb2f0a2cdfb6a1267d80cce8388e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Revert "[3.11] GH-92678: Expose managed dict clear and visit functions ↵Mark Shannon2022-08-041-9/+0
| | | | | (GH-95246). (#95256)" (#95647) This reverts commit 7f731943393d57cf26ed5f2353e6e53084cd55fd.
* GH-92678: Fix tp_dictoffset inheritance. (GH-95596) (GH-95604)Mark Shannon2022-08-041-0/+28
| | | | | * Add test for inheriting explicit __dict__ and weakref. * Restore 3.10 behavior for multiple inheritance of C extension classes that store their dictionary at the end of the struct.
* [3.11] gh-95174: WASI: skip missing sockets functions (GH-95179) (GH-95308)Christian Heimes2022-07-314-10/+114
| | | | Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.11] gh-95174: Handle missing dup() and constants in WASI (GH-95229) ↵Christian Heimes2022-07-315-2/+26
| | | | | (GH-95272) Co-authored-by: Christian Heimes <christian@python.org>
* [3.11] GH-93899: fix checks for eventfd flags (GH-95170). (#95342)Kumar Aditya2022-07-282-10/+14
| | | | | (cherry picked from commit 4dd099bafff14639ef5d2185965016d8f253353f) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] gh-95324: Emit a warning if an object doesn't call ↵Miss Islington (bot)2022-07-275-0/+12
| | | | | PyObject_GC_UnTrack during deallocation in debug mode (GH-95325) (#95336) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>