Commit graph

118681 commits

Author SHA1 Message Date
Miss Islington (bot)
1bd2c93474
[3.12] gh-102512: Turn _DummyThread into _MainThread after os.fork() called from a foreign thread (GH-113261) (GH-114430)
Always set a _MainThread as a main thread after os.fork() is called from
a thread started not by the threading module.

A new _MainThread was already set as a new main thread after fork if
threading.current_thread() was not called for a foreign thread before fork.
Now, if it was called before fork, the implicitly created _DummyThread will
be turned into _MainThread after fork.

It fixes, in particularly, an incompatibility of _DummyThread with
the threading shutdown logic which relies on the main thread
having tstate_lock.

(cherry picked from commit 49785b06de)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
2024-01-22 15:24:43 +00:00
Miss Islington (bot)
d1f731ff08
[3.12] gh-111803: Make test_deep_nesting from test_plistlib more strict (GH-114026) (GH-114406)
It is no longer silently passed if RecursionError was raised for low
recursion depth.
(cherry picked from commit db1c18eb62)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-22 17:16:12 +02:00
Miss Islington (bot)
58fdd15d5a
[3.12] gh-108303: Move smtpd to test.support (GH-114368) (#114427)
gh-108303: Move `smtpd` to `test.support` (GH-114368)

Update test_logging.py and test_smtplib.py.
(cherry picked from commit 8f5e7d739f)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-01-22 14:08:31 +00:00
Serhiy Storchaka
7da1750225
[3.12] gh-114115: Update documentation of array.array (GH-114117) (GH-114417)
(cherry picked from commit 650f9e4c94)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-01-22 09:37:16 +00:00
Miss Islington (bot)
33c1907de2
[3.12] gh-114328: tty cbreak mode should not alter ICRNL (GH-114335) (#114410)
The terminal CR -> NL mapping setting should be inherited in cbreak mode as OSes do not specify altering it as part of their stty cbreak mode definition.
(cherry picked from commit fd49e22670)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-01-21 23:41:03 +00:00
Miss Islington (bot)
4c42d98154
[3.12] gh-114241: Fix and improve the ftplib CLI (GH-114242) (GH-114404)
* Fix writing the retrieved binary file to stdout.
* Add a newline after writing warnings to stderr.
* Fix a TypeError if the netrc file doesn't contain a host/default entry.
* Improve the usage message.
(cherry picked from commit 42d72b23dd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-21 20:48:12 +00:00
Erlend E. Aasland
5183a5dee5
[3.12] Docs: align sqlite3 docs with versionadded/versionchanged recommendations (#114400) (#114402)
(cherry picked from commit 336030161a)

When a parameter is added to a function or method, use the 'versionchanged'
directive, not 'versionadded'.
2024-01-21 20:04:01 +00:00
Miss Islington (bot)
1138fb545f
[3.12] Docs: link to sys.stdout in ftplib docs (GH-114396) (#114397)
(cherry picked from commit de17cf444a)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-01-21 17:47:55 +00:00
Jérome Perrin
00e8c9ce9e
[3.12] gh-113358: Fix rendering tracebacks with exceptions with a broken __getattr__ (GH-113359) (#114173) 2024-01-21 17:12:17 +00:00
Miss Islington (bot)
afefa4a74c
[3.12] gh-114384: Align sys.set_asyncgen_hooks signature in docs to reflect implementation (GH-114385) (#114386)
(cherry picked from commit 38768e4cdd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-01-21 13:22:57 +00:00
Miss Islington (bot)
24fa45b59f
[3.12] Docs: mark up FTP() constructor with param list (GH-114359) (#114382)
(cherry picked from commit 96c15b1c8d)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-01-21 11:33:23 +00:00
Miss Islington (bot)
5dc4857661
[3.12] Docs: mark up the FTP debug levels as a list (GH-114360) (#114375)
(cherry picked from commit fbc28748ea)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-01-21 11:26:34 +01:00
Miss Islington (bot)
69f876a82a
[3.12] gh-101100: Fix sphinx warnings in Doc/c-api/memory.rst (GH-114373) (#114377)
gh-101100: Fix sphinx warnings in `Doc/c-api/memory.rst` (GH-114373)
(cherry picked from commit 47133d8d86)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-01-21 09:41:00 +00:00
Miss Islington (bot)
f7d5d936ab
[3.12] Fix the confusing "User-defined methods" reference in the datamodel (GH-114276) (#114365) 2024-01-21 03:52:04 +00:00
Miss Islington (bot)
48bff74590
[3.12] Docs: Add missing line continuation to FTP_TLS class docs (GH-114352) (#114353)
Docs: Add missing line continuation to FTP_TLS class docs (GH-114352)

Regression introduced by b1ad5a5d4.
(cherry picked from commit 8f4f773647)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-01-20 21:21:00 +01:00
Miss Islington (bot)
a4eb0720f1
[3.12] Docs: structure the ftplib reference (GH-114317) (#114347)
Docs: structure the ftplib reference (GH-114317)

Introduce the following headings and subheadings:

- Reference
  * FTP objects
  * FTP_TLS objects
  * Module variables
(cherry picked from commit b1ad5a5d44)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-01-20 19:16:53 +00:00
Adam Turner
82ad7857aa
[3.12] GH-99380: Update to Sphinx 7 (GH-99381) (#114341)
(cherry picked from commit e6495159f6)
2024-01-20 11:28:34 +00:00
Miss Islington (bot)
7a56df1266
[3.12] gh-114332: Fix the flags reference for `re.compile()` (GH-114334) (#114339)
gh-114332: Fix the flags reference for ``re.compile()`` (GH-114334)

The GH-93000 change set inadvertently caused a sentence in re.compile()
documentation to refer to details that no longer followed. Correct this
with a link to the Flags sub-subsection.

(cherry picked from commit 567a85e9c1)

Co-authored-by: David H. Gutteridge <dhgutteridge@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-01-20 11:23:37 +00:00
Miss Islington (bot)
6279b2dc15
[3.12] Retain shorter tables of contents for Sphinx 5.2.3+ (GH-114318) (#114337) 2024-01-20 10:33:15 +00:00
Peter Lazorchak
ae2a25bf60
[3.12] Check for valid tp_version_tag in specializer (gh-89811) (gh-114216) 2024-01-20 04:45:33 +08:00
Miss Islington (bot)
ffac6ac656
[3.12] gh-114286: Fix maybe-uninitialized warning in Modules/_io/fileio.c (GH-114287) (GH-114288)
(cherry picked from commit 05e47202a3)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-01-19 10:58:09 +00:00
Miss Islington (bot)
f9158d63b1
[3.12] gh-112092: clarify unstable ABI recompilation requirements (GH-112093) (#114260)
gh-112092: clarify unstable ABI recompilation requirements (GH-112093)

Use different versions in the examples for when extensions do and do not need to be recompiled to make the examples easier to understand.
(cherry picked from commit 68a7b78cd5)

Co-authored-by: DerSchinken <53398996+DerSchinken@users.noreply.github.com>
2024-01-18 21:28:04 +01:00
Miss Islington (bot)
a76d0104d7
[3.12] gh-108303: Move all doctest related files and tests to Lib/test/test_doctest/ (GH-112109) (#114254)
gh-108303: Move all doctest related files and tests to `Lib/test/test_doctest/` (GH-112109)
(cherry picked from commit 9c93350f58)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Brett Cannon <brett@python.org>
2024-01-18 16:25:04 +00:00
Miss Islington (bot)
6d23b32374
[3.12] gh-110345: show Tcl/Tk patchlevel in tkinter._test() (GH-110350) (GH-114253)
(cherry picked from commit b8f29b1293)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2024-01-18 16:11:03 +00:00
Miss Islington (bot)
281fef1e4c
[3.12] gh-111301: Advertise importlib methods removal in What's new in Python 3.12 (GH-111630) (GH-114187)
(cherry picked from commit f49752552e)

Co-authored-by: Karolina Surma <33810531+befeleme@users.noreply.github.com>
2024-01-18 14:38:13 +01:00
Miss Islington (bot)
c2a2126782
[3.12] gh-113205: test_multiprocessing.test_terminate: Shorter sleep for threadpools (GH-114186) (GH-114222)
Threads can't be forced to terminate (without potentially corrupting too much
state), so the  expected behaviour of `ThreadPool.terminate` is to wait for
the currently executing tasks to finish.

Use shorter sleep time for threadpools, so if a task manages to start, the test
doesn't block for long.

(cherry picked from commit c1db960608)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-01-18 13:49:24 +01:00
Miss Islington (bot)
eb582df61f
[3.12] gh-104522: Fix test_subprocess failure when build Python in the root home directory (GH-114236) (GH-114239)
EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.
(cherry picked from commit 311d1e2701)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-18 13:18:15 +01:00
Miss Islington (bot)
55b73a5c78
[3.12] gh-114231: Fix indentation in enum.rst (GH-114232) (#114234)
Co-authored-by: Miyashita Yosuke <44266492+miyashiiii@users.noreply.github.com>
2024-01-18 09:29:34 +00:00
Miss Islington (bot)
e7a5577b53
[3.12] gh-96905: In IDLE code, stop redefining built-ins 'dict' and 'object' (GH-114227) (#114228)
Prefix 'dict' with 'o', 'g', or 'l' for 'object', 'global', or 'local'.
Suffix 'object' with '_'.
(cherry picked from commit 6f4b242a03)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-18 05:09:26 +00:00
Miss Islington (bot)
35e330ba85
[3.12] gh-114149: [Enum] revert GH-114196 and add more tuple-subclass tests (GH-114215) (GH-114218)
gh-114149: [Enum] revert GH-114160 and add more tuple-subclass tests (GH-114215)

This reverts commit 05e142b154.
(cherry picked from commit 4c7e09d012)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2024-01-17 20:36:28 -08:00
Miss Islington (bot)
87198f6c23
[3.12] gh-114211: Update EmailMessage doc about ordered keys (GH-114224) (#114225)
Ordered keys are no longer unlike 'real dict's.
(cherry picked from commit 8cda72037b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-17 21:55:40 -05:00
Miss Islington (bot)
f8fc8534c4
[3.12] gh-104522: Fix OSError raised when run a subprocess (GH-114195) (#114219)
gh-104522: Fix OSError raised when run a subprocess (GH-114195)

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 e2c097ebde)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Robert O'Shea <PurityLake@users.noreply.github.com>
2024-01-18 01:19:11 +00:00
Tian Gao
2c9cf64a3f
[3.12] gh-112343: pdb: Use tokenize to replace convenience variables (GH-112380) (#114202) 2024-01-17 22:15:44 +00:00
Miss Islington (bot)
c1890e666e
[3.12] gh-114149: [Enum] fix tuple subclass handling when using custom __new__ (GH-114160) (GH-114196)
(cherry picked from commit 33b47a2c28)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2024-01-17 13:34:48 -08:00
Miss Islington (bot)
24d23929d6
[3.12] gh-38807: Fix race condition in Lib/trace.py (GH-110143) (GH-114206)
Instead of checking if a directory does not exist and thereafter
creating it, directly call os.makedirs() with the exist_ok=True.
(cherry picked from commit 78fcde039a)

Co-authored-by: buermarc <44375277+buermarc@users.noreply.github.com>
2024-01-17 20:35:00 +00:00
Serhiy Storchaka
a735fea6b1
[3.12] gh-105102: Fix nested unions in structures when the system byteorder is the opposite (GH-105106) (GH-114204)
(cherry picked from commit 0b541f64c4)

Co-authored-by: Sheidan <37596668+Sh3idan@users.noreply.github.com>
2024-01-17 20:11:44 +00:00
Miss Islington (bot)
01344cfe9e
[3.12] Fix typo in tkinter.ttk.rst (GH-106157) (GH-114200)
(cherry picked from commit 7573c44c32)

Co-authored-by: Christophe Nanteuil <35002064+christopheNan@users.noreply.github.com>
2024-01-17 21:23:50 +02:00
Miss Islington (bot)
74a6b7f639
[3.12] gh-114070: fix token reference warnings in expressions.rst (GH-114169) (#114192)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-01-17 16:46:02 +00:00
Miss Islington (bot)
00e7793519
[3.12] gh-104282: Fix null pointer dereference in lzma._decode_filter_properties (GH-104283) (GH-114181)
(cherry picked from commit 0154405350)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
2024-01-17 13:31:33 +00:00
Miss Islington (bot)
27941b14ab
[3.12] gh-102468: Document PyCFunction_New* and PyCMethod_New (GH-112557) (GH-114119)
gh-102468: Document `PyCFunction_New*` and `PyCMethod_New` (GH-112557)
(cherry picked from commit a482bc67ee)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-01-17 10:21:08 +01:00
Miss Islington (bot)
5af161ffe6
[3.12] gh-72284: Revise lists in IDLE doc (GH-114174) (#114175)
Tkinter is a fact, not necessarily a feature.

Reorganize editor key bindings in a logical order
and remove those that do not work, at least on Windows.

Improve shell bindings list.
(cherry picked from commit 4a32275389)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-17 03:35:19 -05:00
Miss Islington (bot)
f1f2d204d1
[3.12] gh-81479: For Help => IDLE Doc, stop double-spacing some lists. (GH-114168) (#114170)
This matches Firefox format.  Edge double-spaces non-simple
lists but I think it looks worse.
(cherry picked from commit e07a400c31)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-17 01:35:15 -05:00
Miss Islington (bot)
5b08b24f89
[3.12] gh-112043: Align concurrent.futures.Executor.map docs with implementation (GH-114153) (#114164)
The first parameter is named 'fn', not 'func'.
(cherry picked from commit 8d26db45df)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-01-17 01:37:30 +00:00
Miss Islington (bot)
12c6424205
[3.12] gh-88531 Fix dataclass __post_init__/__init__ interplay documentation (gh-107404) (#114162)
* Simplify __post_init__ example usage. It applies to all base classes, not just dataclasses.
(cherry picked from commit 05008c27b7)

Co-authored-by: Steffen Zeile <48187781+Kaniee@users.noreply.github.com>
2024-01-17 01:33:02 +00:00
Miss Islington (bot)
b201a6a1f1
[3.12] gh-106293: Fix typos in Objects/object_layout.md (GH-106294) (#114158)
(cherry picked from commit 60ca37fdee)

Co-authored-by: Mano Sriram <mano.sriram0@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-16 23:35:20 +00:00
Miss Islington (bot)
50bb9c69e1
[3.12] gh-94220: Align fnmatch docs with the implementation and amend markup (GH-114152) (#114155)
- Align the argument spec for fnmatch functions with the actual
  implementation.
- Update Sphinx markup to recent recommandations.
- Add link to 'iterable' glossary entry.

(cherry picked from commit 6e84f3b56f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-01-16 23:42:29 +01:00
Barney Gale
0ee681a665
[3.12] GH-78988: Document pathlib.Path.glob() exception propagation. (GH-114036) (#114154)
We propagate the `OSError` from the `is_dir()` call on the top-level
directory, and suppress all others.

(cherry picked from commit 7092b3f131)
2024-01-16 22:39:09 +00:00
Miss Islington (bot)
59da12613a
[3.12] gh-113659: Skip hidden .pth files (GH-113660) (GH-114143)
Skip .pth files with names starting with a dot or hidden file attribute.
(cherry picked from commit 74208ed0c4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-16 18:57:14 +00:00
Miss Islington (bot)
60f5f7513f
[3.12] Fix 'expresion' typo in IDLE doc (GH-114130) (#114139)
The substantive change is on line 577/593. Rest is header/footer stuff ignored when displaying.
(cherry picked from commit 7a24ecc953)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-16 18:27:43 +00:00
Miss Islington (bot)
10f00294a0
gh-114096: Restore privileges in _winapi.CreateJunction after creating the junction (GH-114089)
This avoids impact on later parts of the application which may be able to do things they otherwise shouldn't.
(cherry picked from commit de4ced54eb)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-01-16 17:39:59 +00:00