Both were added in 3.13, are undocumented, and don't make sense in 3.14 due to
changes in the stack overflow detection machinery (gh-112282).
PEP 387 exception for skipping a deprecation period: https://github.com/python/steering-council/issues/288
We replace it with _Py_GetMainModule(), and add _Py_CheckMainModule(), but both in the internal-only C-API. We also add _PyImport_GetModulesRef(), which is the equivalent of _PyImport_GetModules(), but which increfs before the lock is released.
This is used by a later change related to pickle and handling __main__.
If `Py_IsFinalizing()` is true, non-daemon threads (other than the current one)
are done, and daemon threads are prevented from running, so they
cannot finalize themselves and become done. Joining them (without timeout)
would block forever.
Raise PythonFinalizationError instead of hanging.
Raise even when a timeout is given, for consistency with trying to join your own thread.
See gh-123940 for a use case: calling `join()` from `__del__`. This is
ill-advised, but an exception should at least make it easier to diagnose.
This was in C version from beginning, but available only
on conditional compilation (EXTRA_FUNCTIONALITY). Current
patch adds function to create IEEE contexts to the
pure-python module as well.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This change to the core CPython repo:
* Adds PyManager support to PC/layout
* Adds a warning message to the legacy py.exe if subcommands are invoked
* Add deprecation message to traditional installer
* Updates using/windows docs
* gh-133005: Support `tarfile.open(mode="w|xz", preset=...)`
Support passing the `preset` option to `tarfile.open` when the file
is open with `mode="w|xz"`. This aligns the behavior with `"w:xz"`
mode.
* Also raise an error for `compresslevel` or `preset` with wrong mode
Raise an error if `compresslevel` or `preset` argument is specified
for stream mode with incorrect compression. This should reduce the risk
of mistakes and align the stream modes with regular modes, that raise
an implicit TypeError on unsupported arguments.
* Apply suggestions from code review
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
OpenSSL 3.4.1 mnemonics are not compatible with OpenSSL 3.4.0 ones since
they were renumbered [1, 2]. Consequently, `_ssl_data_34.h` is renamed to
`_ssl_data_340.h` and `_ssl_data_34.h` now contains OpenSSL 3.4.1 mnemonics.
We also refine the mnemonics that are selected, discarding those that are
mnemonic-like but should not be used as such. More precisely, we remove
the ERR_LIB_MASK and ERR_LIB_OFFSET entries from OpenSSL 1.1.1 data.
[1]: https://github.com/openssl/openssl/issues/26316
[2]: https://github.com/openssl/openssl/issues/26388
Clearly note that this is primarily intended for users for who zlib/gzip is a bottleneck.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Support arbitrary bytes-like objects, not only bytes, in fcntl().
* The fcntl() buffer argument is now null-terminated.
* Automatically retry an ioctl() system calls failing with EINTR.
* Release the GIL for an ioctl() system call even for large bytes-like object.
* Do not silence arbitrary errors whet try to get a buffer.
* Optimize argument parsing, check the argument type before trying to get
a buffer or convert it to integer.
* Fix some error messages.
This also reverts loghelper() change in 75f59bb629 for integer
input. The error message shouldn't include argument value here.
Co-authored-by: Victor Stinner <vstinner@python.org>