summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* GH-95045: gc untrack _lsprof.Profiler before deallocating it (GH-95315)Miss Islington (bot)2022-07-271-0/+1
| | | | | | Automerge-Triggered-By: GH:pablogsal (cherry picked from commit deacf391d7a1b3ab49bffa16088b3500fdb4c435) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fails ↵Miss Islington (bot)2022-07-271-1/+7
| | | | | | | (GH-95264) (cherry picked from commit b1f648efc56ff17e18ec2b7402d59a771b305004) Co-authored-by: Noam Cohen <noam@noam.me>
* gh-95041: Fix several minor issues in syslog.openlog() (GH-95058) (GH-95261)Miss Islington (bot)2022-07-261-24/+33
| | | | | | | | | | | | | | * syslog_get_argv() swallows exceptions, but not in all cases. * if ident is non UTF-8 encodable, syslog.openlog() fails after setting the global reference to ident. Now the C string saved internally in the previous call to openlog() points to the freed memory. * PySys_Audit() can crash if ident is NULL. * There may be a race condition with syslog.syslog(), because the global reference to ident is decrefed before setting the new value. * Possible use of freed memory if syslog.openlog() is called while the GIL is released in syslog.syslog(). (cherry picked from commit 68c555a50a2b74731b0db0f4dcbf51b2c11d4853) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] GH-92678: Expose managed dict clear and visit functions (GH-95246). ↵Pablo Galindo Salgado2022-07-251-0/+9
| | | | | (#95256) Co-authored-by: Mark Shannon <mark@hotpy.org>
* gh-90473: Check for HAVE_KILL in main.c:exit_sigint (GH-95165)Miss Islington (bot)2022-07-231-1/+1
| | | | | (cherry picked from commit d291a82df33cd8c917a374fef2a2373beda78b77) Co-authored-by: Christian Heimes <christian@python.org>
* [3.11] gh-95132: Correctly relay *args and **kwds from sqlite3.connect to ↵Erlend Egeberg Aasland2022-07-233-147/+35
| | | | | | | | | | | | | | | factory (GH-95146) (#95158) This PR partially reverts gh-24421 (PR) and fixes the remaining concerns given in gh-93044 (issue): - keyword arguments are passed as positional arguments to factory() - if an argument is not passed to sqlite3.connect(), its default value is passed to factory() Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>. (cherry picked from commit a3d4d15f53777662ce0957500e5a538ce7161f5e) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* gh-95095: Use SSL_CTX_get_max_proto_version instead of SSL_CTX_ctrl (GH-95096)Miss Islington (bot)2022-07-211-2/+2
| | | | | | | | | | The wrapper macros are more readable and match the form recommended in the OpenSSL documentation. They also slightly less error-prone, as the mapping of arguments to SSL_CTX_ctrl is not always clear. (Though in this case it's straightforward.) https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_get_max_proto_version.html (cherry picked from commit 936f71e5d4f50f2238b0320d44f7fb5f88e39809) Co-authored-by: David Benjamin <davidben@davidben.net>
* GH-90699: fix ref counting of static immortal strings (gh-94850)Miss Islington (bot)2022-07-201-1/+1
| | | | | (cherry picked from commit 1834133e66d95a143c9df5f068b3109927aefd65) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-91153: Handle mutating __index__ methods in bytearray item assignment ↵Miss Islington (bot)2022-07-191-0/+16
| | | | | | | (GH-94891) (cherry picked from commit f36589510b8708fa224d799d5b328deab558aa4e) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* gh-94930: skipitem() in getargs.c should return non-NULL on error (GH-94931)Miss Islington (bot)2022-07-181-2/+21
| | | | | (cherry picked from commit 067f0da33506f70c36a67d5f3d8d011c8dae10c9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* GH-94857: fix test_io refleak (GH-94858)Miss Islington (bot)2022-07-181-1/+6
| | | | | (cherry picked from commit 631160c262b40bf4ce3da6cd7bbb972ae2e9fc91) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-94821: Fix autobind of empty unix domain address (GH-94826)Miss Islington (bot)2022-07-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When binding a unix socket to an empty address on Linux, the socket is automatically bound to an available address in the abstract namespace. >>> s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) >>> s.bind("") >>> s.getsockname() b'\x0075499' Since python 3.9, the socket is bound to the one address: >>> s.getsockname() b'\x00' And trying to bind multiple sockets will fail with: Traceback (most recent call last): File "/home/nsoffer/src/cpython/Lib/test/test_socket.py", line 5553, in testAutobind s2.bind("") OSError: [Errno 98] Address already in use Added 2 tests: - Auto binding empty address on Linux - Failing to bind an empty address on other platforms Fixes f6b3a07b7df6 (bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866) (cherry picked from commit c22f134211743cd5ad14cec1dd4f527bee542b4c) Co-authored-by: Nir Soffer <nsoffer@redhat.com>
* GH-89988: Fix memory leak in pickle.Pickler dispatch_table lookup (GH-94298)Miss Islington (bot)2022-07-141-1/+3
| | | | | (cherry picked from commit 01ef1f95dab9c9930ce1a23634a3e5a8331bf3c7) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] bpo-45924: Fix asyncio incorrect traceback when future's exception is ↵Miss Islington (bot)2022-07-111-0/+14
| | | | | raised multiple times (GH-30274) (#94747) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>