summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* [3.11] gh-107801: Improve the accuracy of io.IOBase.seek docs (#108268) ↵Erlend E. Aasland2023-08-291-7/+14
| | | | | | | | | | | (#108656) (cherry picked from commit 8178a88bd81edae87d6974483e4de9b32e808797) - Add param docstrings - Link to os.SEEK_* constants - Mention the return value in the initial paragraph Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* [3.11] gh-107801: Document io.TextIOWrapper.tell (#108265) (#108548)Erlend E. Aasland2023-08-272-3/+12
| | | (cherry picked from commit 38afa4af9bfc8297a5ee270c37f3f120a04297ea)
* [3.11] gh-107913: Fix possible losses of OSError error codes (GH-107930) ↵Serhiy Storchaka2023-08-2714-75/+122
| | | | | | | | (GH-108524) Functions like PyErr_SetFromErrno() and SetFromWindowsErr() should be called immediately after using the C API which sets errno or the Windows error code. (cherry picked from commit 2b15536fa94d07e9e286826c23507402313ec7f4)
* [3.11] Revert "gh-46376: Return existing pointer when possible in ctypes ↵Łukasz Langa2023-08-241-29/+0
| | | | | | | (GH-107131) (GH-107488)" (#108412) This reverts commit 57f27e444175a8a5ffcd86971e06de61c1c38628. The fix caused gh-107940. Until we have a bulletproof fix for that, the 3.11 backport needs to be reverted to make way for 3.11.5.
* [3.11] Trim trailing whitespace and test on CI (GH-104275) (#108215)Hugo van Kemenade2023-08-2216-109/+109
|
* [3.11] gh-102507 Remove invisible pagebreak characters (GH-102531) (#108266)Miss Islington (bot)2023-08-221-3/+0
| | | | | | | gh-102507 Remove invisible pagebreak characters (GH-102531) (cherry picked from commit b097925858c6975c73e989226cf278cc382c0416) Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com> Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
* [3.11] gh-107801: Improve the accuracy of io.TextIOWrapper.seek docs ↵Erlend E. Aasland2023-08-222-5/+39
| | | | | | | | | | | (#107933) (#108264) (cherry picked from commit 7f87ebbc3f52680c939791f397b9a478edf0c8d4) Clearly document the supported seek() operations: - Rewind to the start of the stream - Restore a previous stream position (given by tell()) - Fast-forward to the end of the stream
* [3.11] gh-107801: Improve the accuracy of os.lseek docs (#107935) (#108137)Erlend E. Aasland2023-08-192-8/+22
| | | | | | | | | | - name the last parameter *whence*, like it is for seek() methods on file objects - add param docstrings - structure the valid *whence* params (cherry picked from commit dd4442c8f597af1ec3eaf20f7ad89c4ac7e2dbc9) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* [3.11] gh-100061: Proper fix of the bug in the matching of possessive ↵Serhiy Storchaka2023-08-161-0/+4
| | | | | | | | | | | | quantifiers (GH-102612) (GH-108004) Restore the global Input Stream pointer after trying to match a sub-pattern. Co-authored-by: Ma Lin <animalize@users.noreply.github.com> (cherry picked from commit abd9cc52d94b8e2835322b62c29f09bb0e6fcfe9) Co-authored-by: SKO <41810398+uyw4687@users.noreply.github.com>
* [3.11] gh-106242: Fix path truncation in os.path.normpath (GH-106816) (#107982)Steve Dower2023-08-151-1/+3
| | | Co-authored-by: Finn Womack <flan313@gmail.com>
* [3.11] gh-106844: Fix issues in _winapi.LCMapStringEx (GH-107832) (GH-107875)Serhiy Storchaka2023-08-121-12/+14
| | | | | | | | | * Strings with length from 2**31-1 to 2**32-2 always caused MemoryError, it doesn't matter how much memory is available. * Strings with length exactly 2**32-1 caused OSError. * Strings longer than 2**32-1 characters were truncated due to integer overflow bug. Now strings longer than 2**31-1 characters caused OverflowError. (cherry picked from commit 04cc01453db2f0af72a06440831637f8bf512daf)
* [3.11] gh-107735: Add C API tests for PySys_GetObject() and ↵Serhiy Storchaka2023-08-071-0/+41
| | | | | PySys_SetObject() (GH-107736) (GH-107741) (cherry picked from commit bea5f93196d213d6fbf4ba8984caf4c3cd1da882)
* [3.11] gh-107077: Raise SSLCertVerificationError even if the error is set ↵Miss Islington (bot)2023-08-031-0/+4
| | | | | | | via SSL_ERROR_SYSCALL (GH-107586) (#107588) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: T. Wouters <thomas@python.org>
* [3.11] gh-106263: Fix segfault in `signaldict_repr` in `_decimal` module ↵Charlie Zhao2023-07-311-3/+27
| | | | | | | (#… (#107490) Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com> (cherry picked from commit 3979150a0d406707f6d253d7c15fb32c1e005a77)
* [3.11] gh-46376: Return existing pointer when possible in ctypes (GH-107131) ↵Łukasz Langa2023-07-311-0/+29
| | | | | | | (#107488) (cherry picked from commit 08447b5deb47e2a0df87fa0a0576d300e5c909b4) Co-authored-by: Konstantin <kpp.live+github@gmail.com>
* [3.11] gh-106881: Check for linux/limits.h before including it (#107397) ↵justdan62023-07-281-1/+1
| | | | | | | | | | | | (#107415) * [3.11] gh-106881: Check for linux/limits.h before including it (#107397) * Check for linux/limits.h before including it Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> (cherry picked from commit 11c055f5ff1a353de6d2e77f2af24aaa782878ba) * Fix sphinx-lint error in NEWS entry
* [3.11] gh-104432: Use `memcpy()` to avoid misaligned loads (GH-104433) (#107356)Miss Islington (bot)2023-07-282-7/+25
| | | | | | | | | | gh-104432: Use `memcpy()` to avoid misaligned loads (GH-104433) Fix potential unaligned memory access on C APIs involving returned sequences of `char *` pointers within the :mod:`grp` and :mod:`socket` modules. These were revealed using a ``-fsaniziter=alignment`` build on ARM macOS. (cherry picked from commit f01e4cedba1a17d321664834bb255d9d04ad16ce) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* [3.11] gh-106350: Tkinter: do not ignore return value of `mp_init()` ↵Miss Islington (bot)2023-07-261-2/+3
| | | | | | | (GH-106351) (GH-107259) (cherry picked from commit b5ae7c498438657a6ba0bf4cc216b9c2c93a06c7) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* [3.11] gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data ↵Serhiy Storchaka2023-07-251-1/+36
| | | | | | | (GH-99613) (GH-107224) Previously *consumed was not set in this case. (cherry picked from commit f08e52ccb027f6f703302b8c1a82db9fd3934270)
* [3.11] gh-86493: Fix possible leaks in some modules initialization ↵Serhiy Storchaka2023-07-198-43/+34
| | | | | | | | | (GH-106768) (GH-106855) (GH-106863) [3.11] [3.12] gh-86493: Fix possible leaks in some modules initialization (GH-106768) (GH-106855) Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time. (cherry picked from commit 3e65baee72131b49f4ce8ca2da568a6f2001ce93). (cherry picked from commit a423ddbdeada8a2fd8657453b9e9f58ba0dd921d)
* [3.11] gh-86493: Fix possible leaks in modules initialization: ↵Serhiy Storchaka2023-07-184-84/+43
| | | | | | | _curses_panel, _decimal, posix, xxsubtype (GH-106767) (GH-106849) (GH-106851) (cherry picked from commit 745492355b94d109e47827e5865846f25ae42d26) (cherry picked from commit 970cb8eabaaf5a8311f1aba4ca4968ef7385fce8)
* [3.11] gh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c ↵Miss Islington (bot)2023-07-171-3/+4
| | | | | | | | (GH-106832) (#106836) gh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c (GH-106832) (cherry picked from commit ebf2c56b33553a448da8f60fcd89a622f071b5f4) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-105235: Prevent reading outside buffer during mmap.find() (… ↵Dennis Sweeney2023-07-152-1/+120
| | | | | | | | | | | | (#106710) [3.11] gh-105235: Prevent reading outside buffer during mmap.find() (GH-105252) * Add a special case for s[-m:] == p in _PyBytes_Find * Add tests for _PyBytes_Find * Make sure that start <= end in mmap.find. (cherry picked from commit ab86426a3472ab68747815299d390b213793c3d1)
* [3.11] gh-106033: Get rid of new occurrences of PyDict_GetItem and Py… ↵Serhiy Storchaka2023-06-241-6/+7
| | | | | | | | | | (#106040) [3.11] gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code.. (cherry picked from commit 1d33d5378058671bfabb6f4d4b5bfd4726973ff9)
* [3.11] gh-105375: Improve error handling in _Unpickler_SetInputStream() ↵Erlend E. Aasland2023-06-131-13/+18
| | | | | | | | (#105667) (#105721) Prevent exceptions from possibly being overwritten in case of multiple failures. (cherry picked from commit 217589d4f3246d67c6ef0eb0be2b1c33987cf260)
* [3.11] gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields ↵Erlend E. Aasland2023-06-131-37/+52
| | | | | | | | | | | | | | (#105686) (#105711) * [3.11] gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields (#105686) All fields must be explicitly initialised to prevent manipulation of uninitialised fields in dealloc. Align initialisation order with the layout of the object structs. (cherry picked from commit ca3cc4b95d66f7527ebe0ba4cdb1907082d9bfc8) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105436: The environment block should end with two null wchar_t ↵Miss Islington (bot)2023-06-121-1/+13
| | | | | | | | values (GH-105495) (#105701) gh-105436: The environment block should end with two null wchar_t values (GH-105495) (cherry picked from commit 4f7d3b602d47d61137e82145f601dccfe6f6cd3c) Co-authored-by: Dora203 <66343334+sku2000@users.noreply.github.com>
* [3.11] gh-105375: Harden pyexpat initialisation (#105606) (#105668)Erlend E. Aasland2023-06-111-9/+11
| | | | | | (cherry picked from commit 20a56d8becba1a5a958b167fdb43b1a1b9228095) Add proper error handling to add_errors_module() to prevent exceptions from possibly being overwritten.
* [3.11] gh-105375: Improve error handling in _ctypes (GH-105593) (#105664)Miss Islington (bot)2023-06-111-4/+14
| | | | | | | Prevent repeated PyLong_FromVoidPtr() from possibly overwriting the current exception. (cherry picked from commit e8998e46a7ce8ad336e0941a6da6e50cb88d1e47) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105375: Harden _ssl initialisation (#105599) (#105651)Erlend E. Aasland2023-06-111-6/+15
| | | | | | | | (cherry picked from commit 01f4230460454d4a849a5ba93320142c1a0c93a8) Add proper error handling to prevent reference leaks and overwritten exceptions. Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105375: Improve _decimal error handling (GH-105605) (#105648)Miss Islington (bot)2023-06-111-1/+5
| | | | | | Fix a bug where an exception could end up being overwritten. (cherry picked from commit c932f7284977ebf813313157c52d716ba225a7ac) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105375: Harden _datetime initialisation (GH-105604) (#105646)Miss Islington (bot)2023-06-111-5/+30
| | | | | | Improve error handling so init bails on the first exception. (cherry picked from commit 16d49680b56e00c53c00683b949138e584669fd3) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105375: Improve array.array exception handling (GH-105594) (#105643)Miss Islington (bot)2023-06-111-3/+5
| | | | | | Fix a bug where 'tp_richcompare' could end up overwriting an exception. (cherry picked from commit 35cff545db7c7912046c0ce5627db2e4d2b60f57) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105375: Improve error handling in `zoneinfo` module (GH-105586) ↵Miss Islington (bot)2023-06-091-6/+11
| | | | | | | | | | | (#105613) Fix bugs where exceptions could end up being overwritten because of deferred error handling. (cherry picked from commit 33c92c4f15539806c8aff8574ff30a8b307e3e4d) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105375: Improve error handling in _elementtree (GH-105591) (#105601)Miss Islington (bot)2023-06-091-3/+7
| | | | | | Fix bugs where exceptions could end up being overwritten. (cherry picked from commit 00b599ab5a76023fa0083d7cc5d3c569342a5191) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105375: Improve posix error handling (GH-105592) (#105597)Miss Islington (bot)2023-06-091-4/+8
| | | | | | Fix a bug where an IndexError could end up being overwritten. (cherry picked from commit f668f73bc88cce0112b304d87aa998fb28013c71) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105375: Improve errnomodule error handling (#105590) (#105595)Erlend E. Aasland2023-06-091-2/+5
| | | | | | (cherry picked from commit eede1d2f48b4fe7f7918952d9ebeb744b58668c1) Bail immediately if an exception is set, to prevent exceptions from being overwritten.
* [3.11] gh-105375: Improve _pickle error handling (#105475) (#105583)Erlend E. Aasland2023-06-091-12/+27
| | | | | | (cherry picked from commit 89aac6f6b7b3af046ec137121c90732289e79efc) Error handling was deferred in some cases, which could potentially lead to exceptions being overwritten.
* [3.11] gh-105375: Improve error handling in sqlite3 collation callback ↵Miss Islington (bot)2023-06-071-3/+5
| | | | | | | | (GH-105412) (#105441) Check for error after each call to PyUnicode_FromStringAndSize(). (cherry picked from commit a24a780d937109a0982d807473ae410cc75b0e3b) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-104399: Use newer libtommath APIs when necessary (GH-104407) (#105344)Miss Islington (bot)2023-06-061-2/+21
| | | | | | gh-104399: Use newer libtommath APIs when necessary (GH-104407) (cherry picked from commit 00d73caf804c0474980e471347d6385757af975f) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* [3.11] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) ↵Gregory P. Smith2023-06-012-2/+167
| | | | | | | | | | | | | | | (#105200) Upgrade builds to OpenSSL 1.1.1u. This OpenSSL version addresses a pile if less-urgent CVEs since 1.1.1t. The Mac/BuildScript/build-installer.py was already updated. Also updates _ssl_data_111.h from OpenSSL 1.1.1u, _ssl_data_300.h from 3.0.9. Manual edits to the _ssl_data_300.h file prevent it from removing any existing definitions in case those exist in some peoples builds and were important (avoiding regressions during backporting). (cherry picked from commit ede89af)
* [3.11] gh-104372: Cleanup _posixsubprocess make_inheritable for async signal ↵Gregory P. Smith2023-05-241-34/+91
| | | | | | | | | | | | | | | | safety gh-104518 (#104785) Move all of the Python C API calls into the parent process up front instead of doing PyLong_AsLong and PyErr_Occurred and PyTuple_GET from the post-fork/vfork child process. Much of this was long overdue. We shouldn't have been using PyTuple and PyLong APIs within all of these low level functions anyways. This is a backport of c649df6 for #104518 and the tiny adjustment in d1732fe #104697. Backporting this allows backporting of the real bug fix that requires it. Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
* [3.11] Add IPv6 into to the docstring for socket.getsockname (GH-102961) ↵Miss Islington (bot)2023-05-221-1/+2
| | | | | | | | | (#103137) Add IPv6 into to the docstring for socket.getsockname (GH-102961) (cherry picked from commit ecc5441505cd7cb54f3d38409c732e2e9f102137) Signed-off-by: Brian Haley <haleyb.dev@gmail.com> Co-authored-by: Brian Haley <brianphaley@gmail.com>
* [3.11] gh-104698: Fix reference leak in mmapmodule.c (GH-104700) (#104710)Miss Islington (bot)2023-05-211-3/+19
| | | | | | (cherry picked from commit 99b641886a09252bbcf99a1d322fa8734f1ca30d) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.11] gh-101857: Allow xattr detection on musl libc (GH-101858) (#101894)Miss Islington (bot)2023-05-211-1/+2
| | | | | | | | | | | | | | | gh-101857: Allow xattr detection on musl libc (GH-101858) Previously, we checked exclusively for `__GLIBC__` (AND'd with some other conditions). Checking for `__linux__` instead should be fine. This fixes using e.g. `os.listxattr()` on systems using musl libc. Bug: https://bugs.gentoo.org/894130 (cherry picked from commit 8be8101bca34b60481ec3d7ecaea4a3379fb7dbb) Co-authored-by: Sam James <sam@gentoo.org> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.11] gh-103987: fix several crashes in mmap module (GH-103990) (#104677)Miss Islington (bot)2023-05-201-2/+13
| | | | | | | | gh-103987: fix several crashes in mmap module (GH-103990) (cherry picked from commit ceaa4c3476ac49b5b31954fec53796c7a3b40349) Co-authored-by: Prince Roshan <princekrroshan01@gmail.com> Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.11] GH-102818: Do not call PyTraceBack_Here in sys.settrace trampoline ↵Mark Shannon2023-05-191-0/+28
| | | | | (GH-104650) Backport of GH-104579
* [3.11] gh-104645: fix error handling in marshal tests (GH-104646) (#104663)Miss Islington (bot)2023-05-191-18/+14
| | | | | | gh-104645: fix error handling in marshal tests (GH-104646) (cherry picked from commit ac56a854b418d35ad3838f3072604227dc718fca) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.11] GH-104308: socket.getnameinfo should release the GIL (GH-104307) ↵Miss Islington (bot)2023-05-081-0/+2
| | | | | | | | | | | | | | | | (#104313) GH-104308: socket.getnameinfo should release the GIL (GH-104307) * socket.getnameinfo should release the GIL * 📜🤖 Added by blurb_it. --------- (cherry picked from commit faf196213e60d8a90773e9e5680d3252bd294643) Co-authored-by: Nathaniel J. Smith <njs@pobox.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* [3.11] gh-104265 Disallow instantiation of `_csv.Reader` and `_csv.Writer` ↵Miss Islington (bot)2023-05-081-2/+2
| | | | | | | | (GH-104266) (#104278) gh-104265 Disallow instantiation of `_csv.Reader` and `_csv.Writer` (GH-104266) (cherry picked from commit 06c2a4858b8806abc700a0471434067910db54ec) Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>