Fix typos in the Lib directory as identified by codespell.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 745c9d9dfc)
Automerge-Triggered-By: GH:JulienPalard
It took me longer than I expected to figure out why a random class
I dealt with didn't support weak references. I believe this addition
will make the __slots__/weakref interaction more discoverable to people
having troubles with this. (Before this patch __slots__ was not
mentioned in weakref documentation even once).
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit b24b47e643)
Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
Operating systems without support for TCP_NODELAY will raise an OSError
when trying to set the socket option, but the show can still go on.
(cherry picked from commit 0571b934f5)
Co-authored-by: rtobar <rtobarc@gmail.com>
Numeric(al) Python to NumPy. It seems the old name hasn't been used for some time.
(cherry picked from commit c8bb24166e)
Co-authored-by: Andre Delfino <adelfino@gmail.com>
It seems part of `gethostbyname_ex` doc was copied from `gethostbyaddr`. The latter has an `ip_address` parameter whereas the former doesn't.
(cherry picked from commit 4103280b83)
Co-authored-by: Andre Delfino <adelfino@gmail.com>
Co-authored-by: Andre Delfino <adelfino@gmail.com>
Make enter_context(foo()) / enter_async_context(foo()) equivalent to
`[async] with foo()` regarding __context__ when an exception is raised.
Previously exceptions would be caught and re-raised with the wrong
context when explicitly overriding __context__ with None..
(cherry picked from commit e6d1aa1ac6)
Co-authored-by: John Belmonte <john@neggie.net>
Automerge-Triggered-By: GH:njsmith
On Unix, if the sem_clockwait() function is available in the C
library (glibc 2.30 and newer), the threading.Lock.acquire() method
now uses the monotonic clock (time.CLOCK_MONOTONIC) for the timeout,
rather than using the system clock (time.CLOCK_REALTIME), to not be
affected by system clock changes.
configure now checks if the sem_clockwait() function is available.
(cherry picked from commit 6df8c32753)
Co-authored-by: Victor Stinner <vstinner@python.org>
Add a PID to names of POSIX shared memory objects to allow
running multiprocessing tests (test_multiprocessing_fork,
test_multiprocessing_spawn, etc) in parallel.
(cherry picked from commit eb4495e8e2)
* Work correctly if an additional fresh module imports other
additional fresh module which imports a blocked module.
* Raises ImportError if the specified module cannot be imported
while all additional fresh modules are successfully imported.
* Support blocking packages.
* Always restore the import state of fresh and blocked modules
and their submodules.
* Fix test_decimal and test_xml_etree which depended on an undesired
side effect of import_fresh_module().
(cherry picked from commit ec4d917a6a)
Removed extra comma in comment that indicates state of a `Barrier` as it was confusing and breaking the flow while reading.
Co-authored-by: Priyank <5903604+cpriyank@users.noreply.github.com>
(cherry picked from commit f1ca5d7f61)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* during tarfile parsing, a zlib error indicates invalid data
* tarfile.open now raises a descriptive exception from the zlib error
* this makes it clear to the user that they may be trying to open a
corrupted tar file.
(cherry picked from commit b6fe857250)
Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
IDLE recognizes Ctrl-D, as on other systems, instead of Ctrl-Z.
(cherry picked from commit e649e0658f)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Fix the threading._shutdown() function when the threading module was
imported first from a thread different than the main thread: no
longer log an error at Python exit.
(cherry picked from commit 95d3137082)
Fix a race condition in the Thread.join() method of the threading
module. If the function is interrupted by a signal and the signal
handler raises an exception, make sure that the thread remains in a
consistent state to prevent a deadlock.
(cherry picked from commit a22be4943c)
Co-authored-by: Victor Stinner <vstinner@python.org>