Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
This was left out of the 3.12 backport for three related issues:
- gh-107219 (which adds `self.call_queue._writer.close()` to `_ExecutorManagerThread` in `concurrent.futures`)
- gh-109370 (which changes this to be only called on Windows)
- gh-109047 (which moves the call to `multiprocessing.Queue`'s `_terminate_broken`)
Without this change, ProcessPoolExecutor sometimes hangs on Windows
when a worker process is terminated.
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
On Alpine Linux it could leave some field non-initialized.
(cherry picked from commit d22c066b80)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
The iterator returned by ElementTree.iterparse() may hold on to a file
descriptor. The reference cycle prevented prompt clean-up of the file
descriptor if the returned iterator was not exhausted.
(cherry picked from commit ce01ab536f)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Also correct the default flag param for dbm.dumb.open();
it's 'c', not 'r'.
(cherry picked from commit 8c265408c5)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Use rst substitutions to reduce raw text duplication.
(cherry picked from commit 01105c7c4f)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Clarify that *target_is_directory* only matters if the target doesn't
exist.
(cherry picked from commit b822b85ac1)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
Remove a double negative in the documentation of `mkdir()`'s *exist_ok*
parameter.
(cherry picked from commit 32c227470a)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-114275: Skip doctests that use `asyncio` in `test_pdb` for WASI builds (GH-114309)
(cherry picked from commit efb81a60f5)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
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>
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>
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>
* 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>
(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>
(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>
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>
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>
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>