summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [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>
* [3.11] bpo-37013: Fix the error handling in socket.if_indextoname() ↵Miss Islington (bot)2023-12-251-5/+11
| | | | | | | | | (GH-13503) (GH-112598) * Fix a crash when pass UINT_MAX. * Fix an integer overflow on 64-bit non-Windows platforms. (cherry picked from commit 0daf555c6fb3feba77989382135a58215e1d70a5) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.11] gh-110190: Fix ctypes structs with array on Arm (#112604) (#112766)Diego Russo2023-12-062-18/+71
| | | | | | | | | Set MAX_STRUCT_SIZE to 32 in stgdict.c when on Arm platforms. This because on Arm platforms structs with at most 4 elements of any floating point type values can be passed through registers. If the type is double the maximum size of the struct is 32 bytes. On x86-64 Linux, it's maximum 16 bytes hence we need to differentiate. (cherry picked from commit bc68f4a4abcfbea60bb1db1ccadb07613561931c)
* [3.11] gh-105967: Work around a macOS bug, limit zlib C library crc32 API ↵Miss Islington (bot)2023-12-042-10/+26
| | | | | | | | | | | | | | calls to 1gig (GH-112615) (#112725) gh-105967: Work around a macOS bug, limit zlib C library crc32 API calls to 1gig (GH-112615) Work around a macOS bug, limit zlib crc32 calls to 1GiB. Without this, `zlib.crc32` and `binascii.crc32` could produce incorrect results on multi-gigabyte inputs depending on the macOS version's Apple supplied zlib implementation. (cherry picked from commit 4eddb4c9d9452482c9af7fa9eec223d12b5a9f33) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.11] gh-109786: Fix leaks and crash when re-enter ↵Miss Islington (bot)2023-12-041-2/+11
| | | | | | | itertools.pairwise.__next__() (GH-109788) (GH-112700) (cherry picked from commit 6ca9d3e0173c38e2eac50367b187d4c1d43f9892) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-112678: Declare `Tkapp_CallDeallocArgs()` as `static` (GH-112679) ↵Miss Islington (bot)2023-12-041-1/+1
| | | | | | | (GH-112691) (cherry picked from commit 23e001fa9f1897ba3384c02bbbe634313358a549) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* [3.11] bpo-35191: Fix unexpected integer truncation in socket.setblocking() ↵Alexey Izbyshev2023-12-011-3/+5
| | | | | | | | | (GH-10415) On platforms with 64-bit long, socket.setblocking(x) treated all x which lower 32 bits are zero as False due to integer truncation. Reported by ubsan.
* [3.11] gh-112105: Make completer delims work on libedit (gh-112106) (gh-112488)Miss Islington (bot)2023-11-281-0/+16
| | | | | | gh-112105: Make completer delims work on libedit (gh-112106) (cherry picked from commit 2df26d83486b8f9ac6b7df2a9a4669508aa61983) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
* [3.11] bpo-41422: Visit the Pickler's and Unpickler's memo in tp_traverse ↵Serhiy Storchaka2023-11-271-0/+14
| | | | | | | (GH-21664) (GH-112465) (cherry picked from commit 967f2a3052c2d22e31564b428a9aa8cc63dc2a9f) Co-authored-by: kale-smoothie <34165060+kale-smoothie@users.noreply.github.com>
* [3.11] gh-111942: Fix crashes in TextIOWrapper.reconfigure() (GH-111976) ↵Miss Islington (bot)2023-11-151-4/+46
| | | | | | | | | | | | | (GH-112059) * 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. (cherry picked from commit ee06fffd38cb51ce1c045da9d8336d9ce13c318a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>