summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* GH-90985: Revert "Deprecate passing a message into cancel()" (GH-97999)Miss Islington (bot)2022-10-241-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>
* gh-96821: Fix undefined behaviour in `_testcapimodule.c` (GH-96915) (GH-96927)Miss Islington (bot)2022-10-221-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-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK ↵Miss Islington (bot)2022-10-221-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-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>
* GH-94736: Fix _multiprocessing.SemLock subclassing (GH-94738)Miss Islington (bot)2022-07-111-4/+2
| | | | | | | | | | | | * fix allocator and deallocator * 📜🤖 Added by blurb_it. * code review Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> (cherry picked from commit f5b76330cfb93e1ad1a77c71dafe719f6a808cec) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-94637: Release GIL in SSLContext.set_default_verify_paths (GH-94658)Miss Islington (bot)2022-07-091-1/+5
| | | | | (cherry picked from commit 78307c7dc2352b6633138466debd4c10fae32970) Co-authored-by: Christian Heimes <christian@python.org>
* gh-94321: Document sqlite3.PrepareProtocol (GH-94620)Miss Islington (bot)2022-07-071-0/+3
| | | | | (cherry picked from commit fb6dccae348b954d9f625031b54711a9a33da525) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
* GH-94644: fix test_curses ref leak (GH-94647)Miss Islington (bot)2022-07-071-0/+1
| | | | | (cherry picked from commit 277f55cb04409ccdf651d43df5eb9dcb3ee3128c) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] gh-94510: Raise on re-entrant calls to sys.setprofile and ↵Łukasz Langa2022-07-051-1/+1
| | | | | | | | sys.settrace (GH-94511) (GH-94578) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 40d81fd63b46cf998880ce3bf3e5cb42bc3199c1)
* [3.11] gh-94404: Use module CFLAGS before PY_STDMODULE_CFLAGS (GH-94413) ↵Christian Heimes2022-06-291-3/+4
| | | | | | | (GH-94415) ``PY_STDMODULE_CFLAGS`` may contain include directories with system headers. This can break compiling with built-in libmpdec. Co-authored-by: Christian Heimes <christian@python.org>
* gh-94404: makesetup: use correct CFLAGS and macOS workaround (GH-94405)Miss Islington (bot)2022-06-291-5/+11
| | | | | | | ``makesetup`` now works around an issue with sed on macOS and uses correct CFLAGS for object files that end up in a shared extension. (cherry picked from commit 5150cbcd6821c0cf79b81cfc8780087bbc6985da) Co-authored-by: Christian Heimes <christian@python.org>
* GH-94254: Make _struct module types immutable (GH-94269)Miss Islington (bot)2022-06-261-2/+4
| | | | | (cherry picked from commit 17ed560fcd0a1442485f9bd48884bbe412f35abc) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] gh-90016: Reword sqlite3 adapter/converter docs (GH-93095) (#94272)Erlend Egeberg Aasland2022-06-252-11/+11
| | | | | | | Also add adapters and converter recipes. Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com. (cherry picked from commit bd3c1c187e0e4fde5aec6835d180e9eddde8ceb6)
* gh-94207: Fix struct module leak (GH-94239) (GH-94265)Miss Islington (bot)2022-06-251-2/+20
| | | | | | | | | | | | | | Make _struct.Struct a GC type This fixes a memory leak in the _struct module, where as soon as a Struct object is stored in the cache, there's a cycle from the _struct module to the cache to Struct objects to the Struct type back to the module. If _struct.Struct is not gc-tracked, that cycle is never collected. This PR makes _struct.Struct GC-tracked, and adds a regression test. (cherry picked from commit 6b865349aae47b90f9ef0b98f3fe3720c2f05601) Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* gh-84461: Fix ctypes and test_ctypes on Emscripten (GH-94142)Miss Islington (bot)2022-06-241-1/+5
| | | | | | | | - c_longlong and c_longdouble need experimental WASM bigint. - Skip tests that need threading - Define ``CTYPES_MAX_ARGCOUNT`` for Emscripten. libffi-emscripten 2022-06-23 supports up to 1000 args. (cherry picked from commit 8625802d854ec0152177a6ff0ac092e0e3ff98a5) Co-authored-by: Christian Heimes <christian@python.org>
* Fix typo in _io.TextIOWrapper Clinic input (GH-94037) (GH-94116)Miss Islington (bot)2022-06-221-2/+2
| | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit ca308c13daa722f3669a14f1613da768086beb6a) Co-authored-by: fikotta <81991278+fikotta@users.noreply.github.com>
* gh-94101 Disallow instantiation of SSLSession objects (GH-94102)Miss Islington (bot)2022-06-221-1/+2
| | | | | | | | Fixes GH-94101 Automerge-Triggered-By: GH:tiran (cherry picked from commit dc8e1d0390e16e90b2f74f6bd6417324a357bc23) Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
* DOC: correct bytesarray -> bytearray in comments (GH-92410) (GH-94089)Miss Islington (bot)2022-06-222-2/+2
| | | | | (cherry picked from commit 0709586744ec58dd60492e16b08fff6dc1149a0a) Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
* gh-94028: Clear and reset sqlite3 statements properly in cursor iternext ↵Miss Islington (bot)2022-06-211-0/+3
| | | | | | | (GH-94042) (cherry picked from commit 94eeac03dc8c643ff050e7d0d306637d9556f798) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
* gh-91985: Ensure in-tree builds override platstdlib_dir in every path ↵Miss Islington (bot)2022-06-201-1/+2
| | | | | | | calculation (GH-93641) (cherry picked from commit 38af903506e9b18c6350c1dadcb489f057713f36) Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
* gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938) (#94000)Victor Stinner2022-06-205-6/+0
| | | | | | | | | | | | | | | | | | Move the follow functions and type from frameobject.h to pyframe.h, so the standard <Python.h> provide frame getter functions: * PyFrame_Check() * PyFrame_GetBack() * PyFrame_GetBuiltins() * PyFrame_GetGenerator() * PyFrame_GetGlobals() * PyFrame_GetLasti() * PyFrame_GetLocals() * PyFrame_Type Remove #include "frameobject.h" from many C files. It's no longer needed. (cherry picked from commit 27b989403356ccdd47545a93aeab8434e9c69f21)