Commit graph

28161 commits

Author SHA1 Message Date
Miss Islington (bot)
d8a56ea439
[3.12] gh-116296: Fix refleak in reduce_newobj() corner case (GH-116297) (#116299)
(cherry picked from commit 17c4849981)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2024-03-04 10:04:44 +00:00
Miss Islington (bot)
3f830adf58
[3.12] gh-115809: Improve TimedRotatingFileHandler.getFilesToDelete() (GH-115812) (GH-116261)
Improve algorithm for computing which rolled-over log files to delete
in logging.TimedRotatingFileHandler. It is now reliable for handlers
without namer and with arbitrary deterministic namer that leaves
the datetime part in the file name unmodified.
(cherry picked from commit 87faec28c7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-03 07:59:10 +00:00
Miss Islington (bot)
25b21596fe
[3.12] GH-115978: Disable *readv() and *writev() on WASI (GH-116228) (GH-116231)
GH-115978: Disable `*readv()` and `*writev()` on WASI (GH-116228)

Wasmtime doesn't implement these functions in a way to pass test_posix (https://github.com/bytecodealliance/wasmtime/issues/7830).
(cherry picked from commit 5dc8c84d39)

Co-authored-by: Brett Cannon <brett@python.org>
2024-03-02 01:11:41 +00:00
Miss Islington (bot)
90f75e1069
[3.12] gh-112281: Allow Union with unhashable Annotated metadata (GH-112283) (#116213)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-01 18:01:27 +00:00
Miss Islington (bot)
8dae3faab6
[3.12] gh-88352: Fix logging.TimedRotatingFileHandler (GH-116191) (GH-116208)
* Do not overwrite already rolled over files. It happened at midnight or
  during the DST change and caused the loss of data.
* computeRollover() now always return the timestamp larger than the
  specified time.
* Fix computation of the rollover time during the DST change.
(cherry picked from commit fee86fd9a4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-01 18:41:30 +02:00
Miss Islington (bot)
d341098c59
[3.12] gh-101293: Fix support of custom callables and types in inspect.Signature.from_callable() (GH-115530) (GH-116198)
Support callables with the __call__() method and types with
__new__() and __init__() methods set to class methods, static
methods, bound methods, partial functions, and other types of
methods and descriptors.

Add tests for numerous types of callables and descriptors.
(cherry picked from commit 59167c962e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-01 12:59:49 +00:00
Tian Gao
40e9295a58
[3.12] gh-87115: Set __main__.__spec__ to None in pdb (GH-116141) (#116154)
* gh-87115: Set `__main__.__spec__` to `None` in pdb (#116141)

(cherry picked from commit ccfc042bbf)

* [3.12] gh-87115: Set `__main__.__spec__` to `None` in pdb (GH-116141)
(cherry picked from commit ccfc042bbf)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-02-29 23:24:09 +00:00
Miss Islington (bot)
211b55951d
[3.12] gh-112844: Add SBOM for external dependencies (GH-115789) (#116128)
Co-authored-by: Seth Michael Larson <seth@python.org>
2024-02-29 21:32:14 +00:00
Miss Islington (bot)
240e5f613b
[3.12] Docs: mark up NotImplemented using the :data: role throughout the docs (GH-116135) (#116147)
(cherry picked from commit dbe44f150c)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-02-29 20:53:51 +00:00
Irit Katriel
6359141867
[3.12] gh-116034: fix location info on the error of a failed assertion (#116054) 2024-02-29 12:36:54 +00:00
Miss Islington (bot)
542f3272f5
[3.12] gh-114572: Fix locking in cert_store_stats and get_ca_certs (GH-114573) (GH-115547)
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 bce693111b)

Co-authored-by: David Benjamin <davidben@google.com>
2024-02-29 08:53:56 +01:00
Miss Islington (bot)
dec637a953
[3.12] gh-115197: Stop resolving host in urllib.request proxy bypass (GH-115210)
gh-115197: Stop resolving host in urllib.request proxy bypass (GH-115210)

Use of a proxy is intended to defer DNS for the hosts to the proxy itself, rather than a potential for information leak of the host doing DNS resolution itself for any reason.  Proxy bypass lists are strictly name based.  Most implementations of proxy support agree.
(cherry picked from commit c43b26d02e)

Co-authored-by: Weii Wang <weii.wang@canonical.com>
2024-02-28 20:47:25 +00:00
Miss Islington (bot)
418e720413
[3.12] gh-112006: Fix inspect.unwrap() for types where __wrapped__ is a data descriptor (GH-115540) (GH-115966)
(cherry picked from commit 68c79d21fa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-27 18:32:34 +00:00
Miss Islington (bot)
3af945fbb4
[3.12] bpo-43952: Fix multiprocessing Listener authkey bug (GH-25845) (GH-115995)
Listener.accept() no longer hangs when authkey is an empty bytes object.
(cherry picked from commit 686ec17f50)

Co-authored-by: Miguel Brito <5544985+miguendes@users.noreply.github.com>
2024-02-27 16:13:53 +00:00
Miss Islington (bot)
3185a1ba11
[3.12] bpo-44865: Fix yet one missing translations in argparse (GH-27668) (GH-115974)
(cherry picked from commit 6087315926)

Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
2024-02-26 23:09:57 +00:00
Serhiy Storchaka
f0c194ad15
[3.12] gh-77956: Add the words 'default' and 'version' help text localizable (GH-12711) (GH-115967)
(cherry picked from commit da382aaf52)

Co-authored-by: paul.j3
Co-authored-by: Emmanuel Arias <eamanu@yaerobi.com>
Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
2024-02-26 21:11:27 +00:00
Miss Islington (bot)
7b91b9001a
[3.12] gh-114763: Protect lazy loading modules from attribute access races (GH-114781) (GH-115870)
gh-114763: Protect lazy loading modules from attribute access races (GH-114781)

Setting the __class__ attribute of a lazy-loading module to ModuleType enables other threads to attempt to access attributes before the loading is complete. Now that is protected by a lock.
(cherry picked from commit 200271c61d)

Co-authored-by: Chris Markiewicz <effigies@gmail.com>
2024-02-26 20:43:44 +00:00
Alex Waygood
53b84e772c
[3.12] gh-115881: Ensure ast.parse() parses conditional context managers even with low feature_version passed (#115920) (#115959) 2024-02-26 15:45:38 +00:00
Miss Islington (bot)
1932da0c3d
[3.12] gh-115823: Calculate correctly error locations when dealing with implicit encodings (GH-115824) (#115949)
gh-115823: Calculate correctly error locations when dealing with implicit encodings (GH-115824)
(cherry picked from commit 015b97d19a)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-02-26 13:18:06 +00:00
Serhiy Storchaka
116375eb04
[3.12] gh-115886: Handle embedded null characters in shared memory name (GH-115887) (GH-115906)
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 79811ededd)
2024-02-25 11:09:28 +00:00
Miss Islington (bot)
4ac657a62f
[3.12] gh-67044: Always quote or escape \r and \n in csv.writer() (GH-115741) (GH-115866)
(cherry picked from commit c688c0f130)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-23 20:45:04 +00:00
Miss Islington (bot)
a3bef5664b
[3.12] gh-88516: show file proxy icon in IDLE editor windows on macOS (GH-112894) (#115840)
The platform standard on macOS is to show a proxy icon for open
files in the titlebar of Windows. Make sure IDLE matches this
behaviour.

Don't use both the long and short names in the window title.
The behaviour of other editors (such as Text Editor) is to show
only the short name with the proxy icon.

(cherry picked from commit b48101864c)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-02-22 21:37:17 -05:00
Frank Hoffmann
d2fced7128
[3.12] gh-112364: Correct unparsing of backslashes and quotes in ast.… (#115782)
[3.12] gh-112364: Correct unparsing of backslashes and quotes in ast.unparse (GH-115696)
(cherry picked from commit 69ab93082d)
2024-02-21 23:28:07 +00:00
Miss Islington (bot)
3651c2729a
[3.12] gh-93205: When rotating logs with no namer specified, match whole extension (GH-93224) (GH-115784)
(cherry picked from commit 113687a838)

Co-authored-by: Gabriele Catania <gabriele.ctn@gmail.com>
2024-02-21 21:36:25 +00:00
Miss Islington (bot)
dae7341da2
[3.12] gh-96310: Fix a traceback in argparse when all options in a mutually exclusive group are suppressed (GH-96311) (GH-115767)
Reproducer depends on terminal size - the traceback occurs when there's
an option long enough so the usage line doesn't fit the terminal width.
Option order is also important for reproducibility.

Excluding empty groups (with all options suppressed) from inserts
fixes the problem.
(cherry picked from commit 5f7df88821)

Co-authored-by: Daniel Mach <daniel.mach@suse.com>
2024-02-21 18:20:29 +02:00
Miss Islington (bot)
cab8d07d17
[3.12] gh-115399: Document CVE-2023-52425 under "XML vulnerabilities" (GH-115400) (GH-115760)
Doc/library/xml.rst: Document CVE-2023-52425 under "XML vulnerabilities"
(cherry picked from commit fbd40ce46e)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2024-02-21 12:43:05 +01:00
Miss Islington (bot)
f1c1afd45b
[3.12] gh-86291: linecache: get module name from __spec__ if available (GH-22908) (GH-115731)
This allows getting source code for the __main__ module when a custom
loader is used.
(cherry picked from commit e976baba99)

Co-authored-by: Eugene Toder <eltoder@users.noreply.github.com>
2024-02-20 18:14:24 +00:00
Serhiy Storchaka
5ea86f496a
[3.12] gh-115712: Support CSV dialects with delimiter=' ' and skipinitialspace=True (GH-115721) (GH-115729)
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 937d282150)
2024-02-20 17:53:29 +00:00
Miss Islington (bot)
20907ca844
[3.12] Add missed stream argument (GH-111775) (#115716)
Add missed `stream` argument (GH-111775)

* Add missed `stream` argument

* Add news
(cherry picked from commit 1ff6c1416b)

Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
2024-02-20 11:36:55 -05:00
Miss Islington (bot)
eb745733fe
gh-115543: Update py.exe to know about Python 3.13 and to install 3.12 by default (GH-115544)
(cherry picked from commit 6cd18c75a4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-02-19 21:03:17 +00:00
Miss Islington (bot)
cffb4c78d3
[3.12] gh-60346: Improve handling single-dash options in ArgumentParser.parse_known_args() (GH-114180) (GH-115675)
(cherry picked from commit e47ecbd042)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-19 18:25:09 +00:00
Miss Islington (bot)
323f63574b
[3.12] gh-115154: Fix untokenize handling of unicode named literals (GH-115171) (#115662)
gh-115154: Fix untokenize handling of unicode named literals (GH-115171)
(cherry picked from commit ecf16ee50e)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-02-19 16:38:43 +00:00
Miss Islington (bot)
e25ac3ba1d
[3.12] gh-111358: Fix timeout behaviour in BaseEventLoop.shutdown_default_executor (GH-115622) (#115641)
(cherry picked from commit 53d5e67804)

Co-authored-by: Jamie Phan <jamie@ordinarylab.dev>
2024-02-19 00:17:40 +00:00
Serhiy Storchaka
b9d1efa696
[3.12] gh-115618: Remove improper Py_XDECREFs in property methods (GH-115619) (GH-115620)
(cherry picked from commit 090dd21ab9)
2024-02-17 21:43:59 +00:00
Miss Islington (bot)
dadc7681ab
[3.12] gh-115596: Fix ProgramPriorityTests in test_os permanently changing the process priority (GH-115610) (GH-115616)
(cherry picked from commit 90dd653a61)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2024-02-17 19:14:26 +02:00
Kirill Podoprigora
e32cde54f5
[3.12] gh-107155: Fix help() for lambda function with return annotation (GH-115612)
(cherry picked from commit b9a9e3dd62)
2024-02-17 17:14:41 +02:00
Miss Islington (bot)
23aef575c7
[3.12] gh-100985: Consistently wrap IPv6 IP address during CONNECT (GH-100986) (GH-115591)
Update _get_hostport to always remove square brackets
from IPv6 addresses. Then add them if needed
in "CONNECT .." and "Host: ".
(cherry picked from commit 465db27cb9)

Co-authored-by: Derek Higgins <derekh@redhat.com>
2024-02-17 15:01:48 +02:00
Miss Islington (bot)
9148b77e0a
[3.12] gh-100884: email/_header_value_parser: don't encode list separators (GH-100885) (GH-115592)
ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
(cherry picked from commit 09fab93c3d)

Co-authored-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-02-17 15:00:39 +02:00
Miss Islington (bot)
de347c0207
[3.12] gh-95782: Fix io.BufferedReader.tell() etc. being able to return offsets < 0 (GH-99709) (GH-115599)
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 26800cf25a)

Co-authored-by: 6t8k <58048945+6t8k@users.noreply.github.com>
2024-02-17 14:56:00 +02:00
Miss Islington (bot)
bf0e072980
[3.12] gh-96497: Mangle name before symtable lookup in 'symtable_extend_namedexpr_scope' (GH-96561) (GH-115603)
(cherry picked from commit 664965a1c1)

Co-authored-by: wookie184 <wookie1840@gmail.com>
2024-02-17 14:49:39 +02:00
Jelle Zijlstra
83c7dd5200
[3.12] gh-115570: Fix DeprecationWarnings in test_typing (#115571) (#115574)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-02-16 13:46:48 -08:00
Brett Cannon
0e4f73b8e4
[3.12] GH-113516: don't set LDSHARED when building for WASI (GH-115495) (GH-115496) 2024-02-15 01:19:42 +00:00
Miss Islington (bot)
14930acf5a
[3.12] gh-115399: Upgrade bundled libexpat to 2.6.0 (GH-115431) (#115469)
gh-115399: Upgrade bundled libexpat to 2.6.0 (GH-115431)
(cherry picked from commit 4b2d1786cc)

Co-authored-by: Seth Michael Larson <seth@python.org>
2024-02-14 14:14:34 -08:00
Miss Islington (bot)
50f17a5a0a
[3.12] gh-112302: Move pip SBOM discovery to release-tools (GH-115360) (#115486)
Co-authored-by: Seth Michael Larson <seth@python.org>
2024-02-14 20:43:03 +00:00
Donghee Na
5ec52c35eb
[3.12] gh-112087: Fix reduce logic for the empty reverse iterator for list (gh-115471) 2024-02-14 18:44:26 +00:00
Miss Islington (bot)
d25894332a
[3.12] gh-115243: Fix crash in deque.index() when the deque is concurrently modified (GH-115247) (GH-115465)
(cherry picked from commit 671360161f)

Co-authored-by: kcatss <kcats9731@gmail.com>
2024-02-14 17:17:58 +00:00
Miss Islington (bot)
13af281a53
[3.12] gh-115392: Fix doctest reporting incorrect line numbers for decorated functions (GH-115440) (#115459)
gh-115392: Fix doctest reporting incorrect line numbers for decorated functions (GH-115440)
(cherry picked from commit bb791c7728)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2024-02-14 15:58:14 +00:00
Miss Islington (bot)
45e5599130
[3.12] gh-101100: Fix sphinx warnings in c-api/gcsupport.rst (GH-114786) (#115263)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-02-13 14:25:54 -07:00
Mark Shannon
4d87832d87
[3.12] GH-112215: Backport C recursion changes (GH-115083) 2024-02-13 10:45:59 +01:00
John Belmonte
09c98e4633
[3.12] gh-114563: C decimal falls back to pydecimal for unsupported format strings (GH-114879) (GH-115353)
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 '#' format support

Suggested and prototyped by Stefan Krah.

Fixes gh-114563, gh-91060

(cherry picked from commit 72340d15cd)

Co-authored-by: John Belmonte <john@neggie.net>
Co-authored-by: Stefan Krah <skrah@bytereef.org>
2024-02-12 23:31:12 +02:00