Commit graph

119701 commits

Author SHA1 Message Date
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
Miss Islington (bot)
d49fdc8d16
[3.12] gh-72463: Fix ctypes/test_loading.py so that test_find reports skipped (GH-18312) (GH-116136)
(cherry picked from commit 04d1000071)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2024-02-29 19:39:00 +00:00
Miss Islington (bot)
010aac7c1a
[3.12] Make the iter_except() recipe more compact. (gh-116132) (gh0116133) 2024-02-29 17:37:00 +00:00
Miss Islington (bot)
845123d641
[3.12] gh-116103: Prevent error in WindowsLoadTracker.__del__ on permission error (GH-116105) (GH-116120)
gh-116103: Prevent error in WindowsLoadTracker.__del__ on permission error (GH-116105)
(cherry picked from commit 186fa93876)


gh-116103: Prevent error in WindowsLoadTracker.__del__ if there was a permission error

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-02-29 14:43:05 +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)
31462d4de2
[3.12] gh-115937: Remove implementation details from inspect.signature() docs (GH-116086) (#116106)
gh-115937: Remove implementation details from inspect.signature() docs (GH-116086)
(cherry picked from commit fb2e17b642)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-02-29 01:54:36 -08: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)
d4a1c8e628
[3.12] Update an out-of-date example in the itertools recipe intro (gh-116082) (gh-116084) 2024-02-28 17:19:17 -06:00
Ethan Furman
83ff92d225
[3.12] gh-115821: [Enum] better error message for calling super().__new__() (GH-116065)
Add note to not call super().__new__() in docs.
2024-02-28 15:17:20 -08:00
Miss Islington (bot)
a85e512699
[3.12] Improve all_equal() recipe (gh-116081) (gh-116083) 2024-02-28 17:11:46 -06: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)
91e680b85c
[3.12] GH-115986 Reorder pprint docs and amend some references (GH-116019) (#116061)
GH-115986 Reorder pprint docs and amend some references (GH-116019)

Introduce a new subsubsection, 'Functions', for module level functions,
and place it before the PrettyPrinter class reference.

Also:
- Fix pprint.pprint() references so they properly link to the module
  level function.
- Add links to sys.stdout.
(cherry picked from commit 6c1c94dc51)

Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
2024-02-28 21:06:08 +01:00
Miss Islington (bot)
9df6d1e033
[3.12] doc: Use super() in subclassed JSONEncoder examples (GH-115565) (GH-116047)
doc: Use super() in subclassed JSONEncoder examples (GH-115565)

Replace calls to `json.JSONEncoder.default(self, obj)`
by `super().default(obj)` within the examples of the documentation.
(cherry picked from commit 647053fed1)

Co-authored-by: Jan Max Meyer <jmm@phorward.de>
2024-02-28 14:13:08 +00:00
Miss Islington (bot)
e5e98626a1
[3.12] gh-115961: Improve tests for compressed file-like objects (GH-115963) (GH-116032)
* Increase coverage for compressed file-like objects initialized with a
  file name, an open file object, a file object opened by file
  descriptor, and a file-like object without name and mode attributes
  (io.BytesIO)
* Increase coverage for name, fileno(), mode, readable(), writable(),
  seekable() in different modes and states
* No longer skip tests with bytes names
* Test objects implementing the path protocol, not just pathlib.Path.
(cherry picked from commit e72576c48b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-28 11:00:50 +02: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)
96f98d9777
[3.12] gh-115315: Update time.rst to include microseconds field (%f) in chart (GH-115316) (#115990)
Co-authored-by: Tahoma Software <bacon@tahoma.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-02-27 15:40:17 +02: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
Miss Islington (bot)
8668b3cc2d
[3.12] gh-115931: Fix SyntaxWarnings in test_unparse (GH-115935) (#115948)
gh-115931: Fix `SyntaxWarning`s in `test_unparse` (GH-115935)
(cherry picked from commit b7383b8b71)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-02-26 13:00:14 +00:00
Miss Islington (bot)
79061af448
[3.12] gh-115091: Remove a left-over sentence that refers to Py_OptimizeFlag from ctypes documentation (GH-115092) (GH-115936)
Remove a left-over sentence that refers to an example that was present in Python 3.10 and was using ``Py_OptimizeFlag``.
(cherry picked from commit 915d7dd090)

Co-authored-by: Antti Haapala <antti.haapala@interjektio.fi>
2024-02-26 11:09:14 +01:00
Miss Islington (bot)
daa28d7552
[3.12] Doc: Clarify the return type of Event.wait when timeout is used (GH-104168) (GH-115938)
(cherry picked from commit 37f5d06b1b)

Co-authored-by: Phil Elson <pelson.pub@gmail.com>
2024-02-26 09:59:26 +00:00
Miss Islington (bot)
551e12f893
[3.12] gh-101100: Fix Sphinx warnings in whatsnew/2.1.rst (GH-112357) (#115932)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-02-26 06:55:23 +00:00
Miss Islington (bot)
f1b3b346eb
[3.12] gh-115921: Change 'equation' to 'expression' in random.rst (GH-115927) (#115928)
In uniform function entry.
(cherry picked from commit de0b4f95cb)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-02-26 03:57:09 +00:00
Carol Willing
7307b562b0
[3.12] gh-101100: Fix broken xrefs in fcntl module doc (GH-115691) (#115924)
* clean up fcntl module doc

* simplify

* a few changes, based on suggestion by CAM-Gerlach

* nitpick ignore for a couple other C functions mentioned in the fcntl module doc

* more changes, especially related to LOCK_* constants

* :data: back to :const:

* Apply suggestions from code review



---------

(cherry picked from commit 84a275c4a2)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2024-02-25 17:27:35 -08:00
Miss Islington (bot)
124594913d
[3.12] gh-113479: Link to workaround for subtle issue with takewhile() (gh-115890) (gh-115910) 2024-02-25 12:38:15 +00:00
Miss Islington (bot)
f684e257b1
[3.12] gh-103417: Fix the scheduler example (GH-111497) (GH-115908)
Arguments to enterabs() are specified as Unix time.
If the scheduler use the time.monotonic timer, the code will take
decades to complete.
(cherry picked from commit cb287d3421)

Co-authored-by: mauricelambert <50479118+mauricelambert@users.noreply.github.com>
2024-02-25 14:04:32 +02: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)
6dbf85ce54
[3.12] bpo-14322: added test case for invalid update to hmac (GH-26636) (#115904)
Co-authored-by: Arjun <ccldarjun@icloud.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-02-25 10:49:37 +00:00
Hugo van Kemenade
671b6a348c
[3.12] gh-101100: Fix Sphinx warnings in whatsnew/2.0.rst (GH-112351) (#115902)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-02-25 03:19:20 -07:00
Miss Islington (bot)
041d85fea2
[3.12] Add an example of of custom __repr__ (GH-112761) (#115900)
Added to repr entry in Doc/library/functions.rst.

---------

(cherry picked from commit 5770006ffa)

Co-authored-by: Oh seungmin <tmdals179@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-02-25 08:05:39 +00:00
Miss Islington (bot)
59ec6e8f23
[3.12] Erase some unnecessary quotes on data model doc (GH-113521) (#115896)
Thanks to Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) for help with this bug.

(cherry picked from commit f7455864f2)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2024-02-24 23:30:14 -05:00
Miss Islington (bot)
b4dd31409c
[3.12] gh-115872: Doc: remove obsolete reference to MSI packages (GH-115873) (#115876)
Co-authored-by: partev <petrosyan@gmail.com>
2024-02-24 01:17:24 -07:00
Miss Islington (bot)
71b75f6f15
[3.12] Update http.cookiejar document for cookie object attributes (GH-101885) (#115833)
Update http.cookiejar document for cookie object attributes (GH-101885)
(cherry picked from commit a3859422d1)

Co-authored-by: NewUserHa <32261870+NewUserHa@users.noreply.github.com>
2024-02-23 14:11:59 -08: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)
10907bdad3
[3.12] gh-54358: Clarify data chunking in pyexpat (GH-31629) (GH-115864)
(cherry picked from commit 462a2fc09d)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Éric Araujo <merwok@netwok.org>
2024-02-23 21:25:56 +02:00
Łukasz Langa
2bdd1d6f15
[3.12] gh-90300: Reformat the Python CLI help output (GH-93415) (#115847)
(cherry picked from commit 2e92ffd7fa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-23 18:23:16 +01:00
Miss Islington (bot)
73921f4c57
[3.12] gh-89480: Document the gdb helpers (GH-115657) (GH-115857)
gh-89480: Document the gdb helpers (GH-115657)

Content adapted from https://devguide.python.org/development-tools/gdb/GH-
and https://wiki.python.org/moin/DebuggingWithGdb.

The original content on the Wiki page came from gdb debug help used by
the Launchpad (https://launchpad.net/) team.
Thanks to Anatoly Techtonik and user `rmf` for substantial improvements to the Wiki page.

The history of the Devguide page follows
(with log entries expanded for major content contributions):

Hugo van Kemenade, Sat Dec 30 21:22:04 2023 +0200
Hugo van Kemenade, Fri Dec 8 12:04:32 2023 +0200
Erlend E. Aasland & Hugo van Kemenade, Tue Aug 8 22:05:34 2023 +0200
Satish Mishra, Sat Feb 11 13:54:57 2023 +0530
Hugo van Kemenade, Fri Dec 23 17:33:33 2022 +0200
Skip Montanaro, Hugo, Erlend, & Ezio, Fri Nov 4 05:04:23 2022 -0500

    Add a GDB tips section to Advanced Tools (GH-977)

Adam Turner, Wed Jun 15 21:19:23 2022 +0100
Adam Turner, Tue Jun 14 11:12:26 2022 +0100
Suriyaa, Fri Jun 8 19:39:23 2018 +0200
Jeff Allen, Tue Oct 24 18:12:53 2017 +0100
Jeff Allen, Fri Oct 13 13:43:43 2017 +0100
Mariatta, Wed Jan 4 09:14:55 2017 -0800
Carol Willing, Mon Sep 26 14:50:54 2016 -0700
Zachary Ware, Thu Jul 21 10:42:23 2016 -0500
Georg Brandl, Mon Nov 3 11:28:19 2014 +0100

    Add instruction how to activate python-gdb.py

Georg Brandl, Sun Mar 9 10:32:01 2014 +0100
Georg Brandl, Tue Apr 3 09:12:53 2012 +0200
Georg Brandl, Sat Mar 5 17:32:35 2011 +0100
Dave Malcolm, Fri Jan 21 12:34:09 2011 -0500

    Add documentation on the gdb extension commands provided in libpython.py

    I adapted this from documentation I wrote for the Fedora wiki:
      https://fedoraproject.org/wiki/Features/EasierPythonDebuggingGH-New_gdb_commands
    reformatting it as rst, and making other minor changes

Brett Cannon, Thu Jan 20 15:16:52 2011 -0800
Dave Malcolm, Thu Jan 20 16:17:23 2011 -0500

    Add some notes on the gdb pretty-printer hooks

Antoine Pitrou, Thu Jan 20 21:17:49 2011 +0100

    Give an example backtrace

Antoine Pitrou, Thu Jan 20 21:03:06 2011 +0100

    Expand explanations about gdb support

Brett Cannon, Thu Jan 20 11:33:36 2011 -0800

    Tweak the gdb support title to fit in better with the devguide.

Brett Cannon, Mon Jan 17 21:12:54 2011 +0000

    Short README on gdb support.

(cherry picked from commit 59057ce55a)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: anatoly techtonik <techtonik@gmail.com>
Co-authored-by: Antoine Pitrou <solipsis@pitrou.net>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Dave Malcolm <dmalcolm@redhat.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Georg Brandl <georg@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Jeff Allen <ja.py@farowl.co.uk>
Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Satish Mishra <7506satish@gmail.com>
Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
Co-authored-by: Suriyaa <isc.suriyaa@gmail.com>
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
2024-02-23 17:32:42 +01:00
Miss Islington (bot)
c61ed32b84
gh-114435: Allow test_stat_inaccessible_file() to have matching ino/dev (GH-114571)
This may occur if Windows allows reading stat information from a file even if the current user does not have access.
(cherry picked from commit d91ddff5de)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-02-23 12:35:42 +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
Seth Michael Larson
b254de71d0
[3.12] gh-115663: Remove 'regen-sbom' from the 'regen-all' target (GH-115790) (#115820) 2024-02-22 14:25:41 +00:00
Miss Islington (bot)
eb4774d2b7
[3.12] gh-100762: Fix optimization in gen_close (GH-111069) (#115818)
gh-100762: Fix optimization in gen_close  (GH-111069)
(cherry picked from commit 0db2517687)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-02-22 14:05:59 +00:00
Miss Islington (bot)
db3306081f
[3.12] gh-115795: Doc: fix obsolete URL (GH-115749) (#115803)
gh-115795: Doc: fix obsolete URL (GH-115749)
(cherry picked from commit 7bc79371a6)

Co-authored-by: partev <petrosyan@gmail.com>
2024-02-22 06:51:49 +00: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
Steve Dower
8e70dc8739
gh-113655: Increase stack reserve size on Windows for when running PGO (GH-115770) 2024-02-21 19:46:46 +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