summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-126623: Update libexpat to 2.6.4, make future updates easier ↵Seth Michael Larson2024-12-034-11/+79
| | | | | | (GH-126792) (GH-126798) Update libexpat to 2.6.4, make future updates easier. (cherry picked from commit 3c9996909402fadc98e6ca2a64e75a71a7427352)
* [3.11] gh-111942: Remove an extra incref in textiowrapper_change_encoding ↵Petr Viktorin2024-11-081-1/+0
| | | | (#126542)
* [3.11] gh-123678: Upgrade libexpat 2.6.3 (#123709)Seth Michael Larson2024-09-053-15/+35
| | | (cherry picked from commit e6fe0ac014e8f5b17064c20d1ae937dbd4c761a2)
* [3.11]GH-112275: Fix HEAD_LOCK deadlock in child process after fork (#112336)ChuBoning2024-09-041-5/+5
| | | | | HEAD_LOCK is called from _PyEval_ReInitThreads->_PyThreadState_DeleteExcept before _PyRuntimeState_ReInitThreads reinit runtime->interpreters.mutex which might be locked before fork. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.11] gh-119690: Fixes buffer type confusion in _winapi.CreateNamedPipe ↵Steve Dower2024-09-041-1/+1
| | | | | audit event (#119734) gh-119690: Fixes buffer type confusion in _winapi.CreateNamedPipe audit event
* [3.11] gh-119506: fix _io.TextIOWrapper.write() write during flush (#119507) ↵Inada Naoki2024-08-091-22/+44
| | | | | | | (#120314) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> fix _io.TextIOWrapper.write() write during flush (#119507)
* [3.11] gh-121957: Emit audit events for python -i and python -m asyncio ↵Łukasz Langa2024-07-221-0/+4
| | | | (GH-122118)
* [3.11] gh-118486: Support mkdir(mode=0o700) on Windows (GH-118488) (GH-118739)Steve Dower2024-05-241-2/+40
|
* [3.11] gh-116741: Upgrade libexpat to 2.6.2 (GH-117296) (#118185)Seth Michael Larson2024-04-233-16/+36
| | | | Upgrade libexpat to 2.6.2 (cherry picked from commit c9829eec0883a8991ea4d319d965e123a3cf6c20)
* [3.11] gh-117310: Remove extra DECREF on "no ciphers" error path in ↵Miss Islington (bot)2024-03-281-1/+0
| | | | | | | | | | | | | `_ssl._SSLContext` constructor (GH-117309) (GH-117318) gh-117310: Remove extra DECREF on "no ciphers" error path in `_ssl._SSLContext` constructor (GH-117309) Remove extra self DECREF on ssl "no ciphers" error path. This doesn't come up in practice because nobody links against a broken OpenSSL library that provides nothing. (cherry picked from commit 8cb7d7ff86a1a2d41195f01ba4f218941dd7308c) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.11] gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() ↵Serhiy Storchaka2024-03-251-0/+1
| | | | | | | (GH-32011) (GH-117210) (cherry picked from commit f11d0d8be8af28e1368c3c7c116218cf65ddf93e) Co-authored-by: Erik Soma <stillusingirc@gmail.com>
* [3.11] gh-117021: Fix integer overflow in PyLong_AsPid() on non-Windows ↵Serhiy Storchaka2024-03-211-0/+1
| | | | | | | | 64-bit platforms (GH-117064) (GH-117070) (GH-117075) (cherry picked from commit da2f9d1417a7d28df6e1ced87d64ecf28acb0a5f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit 519b2ae22b54760475bbf62b9558d453c703f9c6)
* [3.11] gh-116773: Fix overlapped memory corruption crash (GH-116774) (#117077)jkriegshauser2024-03-201-0/+18
| | | Manual backport of gh-116774.
* [3.11] gh-106687: _ssl: use uint64_t for SSL options (#106700) (#116665)Victor Stinner2024-03-131-24/+52
| | | | | | | | | | | | gh-106687: _ssl: use uint64_t for SSL options (#106700) SSL_CTX_get_options() uses uint64_t for options: https://www.openssl.org/docs/man3.1/man3/SSL_CTX_get_options.html Fix this compiler warning on Windows with MSC: conversion from 'uint64_t' to 'long', possible loss of data (cherry picked from commit ad95c7253a70e559e7d3f25d53f4772f28bb8b44)
* [3.11] gh-116541: Handle errors correctly in `_pystatvfs_fromstructstatvfs` ↵Miss Islington (bot)2024-03-121-32/+36
| | | | | | | | (GH-116542) (#116644) gh-116541: Handle errors correctly in `_pystatvfs_fromstructstatvfs` (GH-116542) (cherry picked from commit f8147d01da44da2434496d868c86c2785f7244cd) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-116545: Fix error handling in `mkpwent` in `pwdmodule` (GH-116548) ↵Miss Islington (bot)2024-03-111-31/+30
| | | | | | | | (#116594) gh-116545: Fix error handling in `mkpwent` in `pwdmodule` (GH-116548) (cherry picked from commit ffd79bea0f032df5a2e7f75e8c823a09cdc7c7a2) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-116520: Fix error handling in `os_get_terminal_size_impl` in ↵Miss Islington (bot)2024-03-091-6/+17
| | | | | | | | `posixmodule` (GH-116521) (#116540) gh-116520: Fix error handling in `os_get_terminal_size_impl` in `posixmodule` (GH-116521) (cherry picked from commit b4b4e764a798bab60324871074ce4cdebb9d01bb) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-116447: Fix possible UB in `arraymodule` and `getargs` (GH-116459) ↵Miss Islington (bot)2024-03-081-1/+1
| | | | | | | | (#116497) gh-116447: Fix possible UB in `arraymodule` and `getargs` (GH-116459) (cherry picked from commit fdb2d90a274158aee23b526d972172bf41bd4b7e) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-116448: Handle errors correctly in `os_waitid_impl` in ↵Miss Islington (bot)2024-03-071-9/+19
| | | | | | | | `posixmodule` (GH-116449) (#116453) gh-116448: Handle errors correctly in `os_waitid_impl` in `posixmodule` (GH-116449) (cherry picked from commit 882fcede83af783a834b759e4643130dc1307ee3) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) ↵Sebastian Pipping2024-03-065-2/+153
| | | | | | | | | | | | | | | | | | | | | | | | | (GH-115623) (#116268) Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods: - `xml.etree.ElementTree.XMLParser.flush` - `xml.etree.ElementTree.XMLPullParser.flush` - `xml.parsers.expat.xmlparser.GetReparseDeferralEnabled` - `xml.parsers.expat.xmlparser.SetReparseDeferralEnabled` - `xml.sax.expatreader.ExpatParser.flush` Based on the "flush" idea from #115138 (comment) . - Please treat as a security fix related to CVE-2023-52425. (cherry picked from commit 6a95676) (cherry picked from commit 73807eb) (cherry picked from commit eda2963) --------- Includes code suggested-by: Snild Dolkow <snild@sony.com> and by core dev Serhiy Storchaka. Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.11] gh-116404: Handle errors correctly in `wait_helper` in `posixmodule` ↵Miss Islington (bot)2024-03-061-26/+29
| | | | | | | | (GH-116405) (#116407) gh-116404: Handle errors correctly in `wait_helper` in `posixmodule` (GH-116405) (cherry picked from commit 22ccf13b332902142fe0c52c593f9efc152c7761) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-115886: Handle embedded null characters in shared memory name ↵Serhiy Storchaka2024-02-251-2/+12
| | | | | | | (GH-115887) (GH-115907) shm_open() and shm_unlink() now check for embedded null characters in the name and raise an error instead of silently truncating it. (cherry picked from commit 79811ededd160b6e8bcfbe4b0f9d5b4589280f19)
* [3.11] gh-67044: Always quote or escape \r and \n in csv.writer() ↵Miss Islington (bot)2024-02-231-0/+2
| | | | | | | (GH-115741) (GH-115867) (cherry picked from commit c688c0f130906ff7725a126fff143d1389884f89) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-115712: Support CSV dialects with delimiter=' ' and ↵Serhiy Storchaka2024-02-201-0/+10
| | | | | | | | | | | skipinitialspace=True (GH-115721) (GH-115729) (GH-115738) (cherry picked from commit 5ea86f496a4cfb34abbe2b7bb6fa7f25eeeb6294) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> csv.writer() now quotes empty fields if delimiter is a space and skipinitialspace is true and raises exception if quoting is not possible. (cherry picked from commit 937d2821501de7adaa5ed8491eef4b7f3dc0940a)
* [3.11] gh-114572: Fix locking in cert_store_stats and get_ca_certs ↵Miss Islington (bot)2024-02-201-5/+60
| | | | | | | | | | | | | | | | | | | | | | | | (GH-114573) (#115549) gh-114572: Fix locking in cert_store_stats and get_ca_certs (GH-114573) * gh-114572: Fix locking in cert_store_stats and get_ca_certs cert_store_stats and get_ca_certs query the SSLContext's X509_STORE with X509_STORE_get0_objects, but reading the result requires a lock. See https://github.com/openssl/openssl/pull/23224 for details. Instead, use X509_STORE_get1_objects, newly added in that PR. X509_STORE_get1_objects does not exist in current OpenSSLs, but we can polyfill it with X509_STORE_lock and X509_STORE_unlock. * Work around const-correctness problem * Add missing X509_STORE_get1_objects failure check * Add blurb (cherry picked from commit bce693111bff906ccf9281c22371331aaff766ab) Co-authored-by: David Benjamin <davidben@google.com>
* [3.11] gh-95782: Fix io.BufferedReader.tell() etc. being able to return ↵Miss Islington (bot)2024-02-171-1/+10
| | | | | | | | | | | | | | | | | | | | | | offsets < 0 (GH-99709) (GH-115600) lseek() always returns 0 for character pseudo-devices like `/dev/urandom` (for other non-regular files, e.g. `/dev/stdin`, it always returns -1, to which CPython reacts by raising appropriate exceptions). They are thus technically seekable despite not having seek semantics. When calling read() on e.g. an instance of `io.BufferedReader` that wraps such a file, `BufferedReader` reads ahead, filling its buffer, creating a discrepancy between the number of bytes read and the internal `tell()` always returning 0, which previously resulted in e.g. `BufferedReader.tell()` or `BufferedReader.seek()` being able to return positions < 0 even though these are supposed to be always >= 0. Invariably keep the return value non-negative by returning max(former_return_value, 0) instead, and add some corresponding tests. (cherry picked from commit 26800cf25a0970d46934fa9a881c0ef6881d642b) Co-authored-by: 6t8k <58048945+6t8k@users.noreply.github.com>
* [3.11] Upgrade bundled libexpat to 2.6.0 (GH-115399) (GH-115468)Seth Michael Larson2024-02-1411-262/+401
| | | Manual backport due to code differences.
* [3.11] gh-115243: Fix crash in deque.index() when the deque is concurrently ↵Miss Islington (bot)2024-02-141-1/+2
| | | | | | | modified (GH-115247) (GH-115466) (cherry picked from commit 671360161f0b7a5ff4c1d062e570962e851b4bde) Co-authored-by: kcatss <kcats9731@gmail.com>
* [3.11] gh-114563: C decimal falls back to pydecimal for unsupported format ↵John Belmonte2024-02-131-122/+60
| | | | | | | | | | | | | | | | | | | | strings (GH-114879) (GH-115384) Immediate merits: * eliminate complex workarounds for 'z' format support (NOTE: mpdecimal recently added 'z' support, so this becomes efficient in the long term.) * fix 'z' format memory leak * fix 'z' format applied to 'F' * fix missing 'GH-' format support Suggested and prototyped by Stefan Krah. Fixes gh-114563, gh-91060 (cherry picked from commit 72340d15cdfdfa4796fdd7c702094c852c2b32d2) (cherry picked from commit 09c98e4633848ce05df8621f41eb09954b55217a) Co-authored-by: Stefan Krah <skrah@bytereef.org>
* [3.11] gh-114670: Fix `_testbuffer` module initialization (GH-114672) (#115271)Miss Islington (bot)2024-02-111-53/+74
| | | | | (cherry picked from commit 3a5b38e3b465e00f133ff8074a2d4afb1392dfb5) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-115059: Flush the underlying write buffer in ↵Miss Islington (bot)2024-02-091-0/+10
| | | | | | | io.BufferedRandom.read1() (GH-115163) (GH-115206) (cherry picked from commit 846fd721d518dda88a7d427ec3d2c03c45d9fa90) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-115136: Fix possible NULL deref in getpath_joinpath() (GH-115137) ↵Miss Islington (bot)2024-02-081-0/+4
| | | | | | | | (ПР-115158) (cherry picked from commit 9e90313320a2af2d9ff7049ed3842344ed236630) Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru> Co-authored-by: Artem Chernyshev <62871052+dTenebrae@users.noreply.github.com>
* [3.11] gh-46968: Fix invalid reference to Sound eXchange (SoX) 12.17.7 ↵Miss Islington (bot)2024-02-061-24/+22
| | | | | | | license (GH-115094) (GH-115095) (cherry picked from commit b39119916c0daaf5e5fdfec63e18ad97f29e2e72) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.11] gh-89811: Check for valid tp_version_tag in specializer (GH-115045)Peter Lazorchak2024-02-061-0/+29
| | | | | | | * gh-89811: Check for valid tp_version_tag in specializer (GH-113558) * gh-113937 Fix failures in type cache tests due to re-running (GH-113953) * Update backported code for 3.11 specifically
* [3.11] gh-115015: Argument Clinic: fix generated code for METH_METHOD ↵Erlend E. Aasland2024-02-0617-45/+112
| | | | | methods without params (#115016) (#115069) (cherry picked from commit 09096a1647913526a3d4fa69a9d2056ec82a8f37)
* gh-110190: Fix ctypes structs with array on Windows ARM64 (GH-114753)Miss Islington (bot)2024-01-311-1/+1
| | | | | (cherry picked from commit a06b606462740058b5d52fefdcdcd679d4f40260) Co-authored-by: Diego Russo <diego.russo@arm.com>
* Use Unicode unconditionally for _winapi.CreateFile (GH-114611)Steve Dower2024-01-262-13/+19
| | | Currently it switches based on build settings, but argument clinic does not handle it correctly.
* [3.11] gh-114492: Initialize struct termios before calling tcgetattr() ↵Miss Islington (bot)2024-01-231-0/+2
| | | | | | | | (GH-114495) (GH-114503) On Alpine Linux it could leave some field non-initialized. (cherry picked from commit d22c066b802592932f9eb18434782299e80ca42e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-104522: Fix OSError raised when run a subprocess (GH-114195) ↵Serhiy Storchaka2024-01-181-10/+11
| | | | | | | | | | | (GH-114243) Only set filename to cwd if it was caused by failed chdir(cwd). _fork_exec() now returns "noexec:chdir" for failed chdir(cwd). (cherry picked from commit e2c097ebdee447ded1109f99a235e65aa3533bf8) Co-authored-by: Robert O'Shea <PurityLake@users.noreply.github.com>
* [3.11] gh-111777: Fix assertion errors on incorrectly still-tracked GC ↵Miss Islington (bot)2024-01-171-1/+5
| | | | | | | | | | | | | | object destruction (GH-111778) (GH-111990) 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. (cherry picked from commit ce6a533c4bf1afa3775dfcaee5fc7d5c15a4af8c) Co-authored-by: T. Wouters <thomas@python.org>
* [3.11] gh-70835: Clarify error message for CSV file opened with wrong ↵Miss Islington (bot)2024-01-171-1/+2
| | | | | | | | newline (GH-113786) (GH-113906) Based on patch by SilentGhost. (cherry picked from commit 568d220993fa9b4b812ff1b425edd80dbe17dda9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-104282: Fix null pointer dereference in ↵Miss Islington (bot)2024-01-171-1/+3
| | | | | | | `lzma._decode_filter_properties` (GH-104283) (GH-114182) (cherry picked from commit 0154405350c272833bd51f68138223655e142a37) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
* gh-114096: Restore privileges in _winapi.CreateJunction after creating the ↵Steve Dower2024-01-161-9/+25
| | | | | junction (GH-114089) This avoids impact on later parts of the application which may be able to do things they otherwise shouldn't.
* gh-81489: Use Unicode APIs for mmap tagname on Windows (GH-14133)Steve Dower2024-01-111-23/+24
| | | | Co-authored-by: Zackery Spytz <zspytz@gmail.com> Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-87868: Sort and remove duplicates in getenvironment() (GH-102731)Miss Islington (bot)2024-01-111-5/+162
| | | | | | | | (cherry picked from commit c31be58da8577ef140e83d4e46502c7bb1eb9abf) Co-authored-by: AN Long <aisk@users.noreply.github.com> 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>
* [3.11] gh-80109: Fix io.TextIOWrapper dropping the internal buffer during ↵Miss Islington (bot)2024-01-081-4/+8
| | | | | | | | | write() (GH-22535) (GH-113809) io.TextIOWrapper was dropping the internal decoding buffer during read() and write() calls. (cherry picked from commit 73c93265634257b1488262097e024c1727260cfd) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.11] gh-110190: Fix ctypes structs with array on PPCLE64 (GH-112959) (#113167)Diego Russo2024-01-052-59/+124
| | | | | | | Fix the same issue of PR #112604 on PPC64LE platform Refactor tests to make easier to add more platfroms if needed. (cherry picked from commit 6644ca45cde9ca1b80513a90dacccfeea2d98620) Change-Id: I1ada30808c0d593a43eca3fa7a628c26bc276310
* [3.11] gh-62260: Fix ctypes.Structure subclassing with multiple layers ↵Serhiy Storchaka2024-01-012-6/+6
| | | | | | | | | | | | | | | (GH-13374) (GH-113624) 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. (cherry picked from commit 5f3cc90a12d6df404fd6f48a0df1334902e271f2) Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
* [3.11] gh-113566: Fix asyncio segfault during interpreter finalization (#113578)Guido van Rossum2023-12-301-0/+3
|
* [3.11] bpo-11102: Make configure enable major(), makedev(), and minor() on ↵Miss Islington (bot)2023-12-281-4/+5
| | | | | | | | | | HP-UX (GH-19856) (GH-113541) Always include <sys/types.h> before <sys/sysmacros.h>. (cherry picked from commit f108468970bf4e70910862476900f924fb701399) Co-authored-by: Zackery Spytz <zspytz@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>