The following types are now immutable:
* `_curses_panel.panel`,
* `[posix,nt].ScandirIterator`, `[posix,nt].DirEntry` (exposed in `os.py`),
* `_remote_debugging.RemoteUnwinder`,
* `_tkinter.Tcl_Obj`, `_tkinter.tkapp`, `_tkinter.tktimertoken`,
* `zlib.Compress`, and `zlib.Decompress`.
Remove dead code in code gen - codegen_check_annotation is only called if future annotations are enabled, and if future annotations are enabled it does nothing.
The codecs lookup function now performs only minimal normalization of
the encoding name before passing it to the search functions:
all ASCII letters are converted to lower case, spaces are replaced
with hyphens.
Excessive normalization broke third-party codecs providers, like
python-iconv.
Revert "bpo-37751: Fix codecs.lookup() normalization (GH-15092)"
This reverts commit 20f59fe1f7.
Follow-up refactoring after GH-133143, where we use `_Py_ID` for "big" and "little"
in `abi_info.byteorder`.
This uses `_Py_ID` for `sys.byteorder`, but also `float_repr_style` and a module name.
In bf8bbe9a81, `getpass.getpass` gained
the ability to provide keyboard feedback through `echo_char`.
On Unix, line editing shortcuts such as Ctrl+U were previously handled
as the terminal operates in canonical mode (see termios(3)). However,
since keyboard feedback requires to switch to noncanonical mode, this
now results in an inconsistency when `getpass.getpass` uses `echo_char`
as those shortcuts are no more supported. This limitation is specific
to Unix and does not affect Windows users where line editing shortcuts
were never supported.
While file timestamps can be anything the file system can store, most
lie between the recent past and the near future. Optimize fill_time()
for typical timestamps in three ways:
- When possible, convert to nanoseconds with C arithmetic.
- When using C arithmetic and the seconds member is not required (for
st_birthtime), avoid creating a long object.
- When using C arithmetic, reorder the code to avoid the null checks
implied in Py_XDECREF().
Co-authored-by: Victor Stinner <vstinner@python.org>
Adds a --no-randomize option to the CI runner, so that randomisation can be easily
disabled for --fast-ci and --slow-ci configurations on single-threaded testing platforms
like Android, iOS, and Emscripten.
---------
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Move PYTHON_API_VERSION & PYTHON_ABI_VERSION to patchlevel.h
This allows removing #include "modsupport.h" from python_ver_rc.h,
which allows modsupport.h to use common helpers from Python.h --
specifically, `_Py_PACK_VERSION` for defining limited API.
* KeyError is not raised for defaultdict
* Fix relative paths on different drives on Windows
* Add a round-trip test
Co-authored-by: Itamar Oren <itamarost@gmail.com>
The signature algorithms allowed for certificate-based client authentication or
for the server to complete the TLS handshake can be defined on a SSL context via
`ctx.set_client_sigalgs()` and `ctx.set_server_sigalgs()`.
With OpenSSL 3.4 or later, the list of available TLS algorithms can be retrieved
by `ssl.get_sigalgs()`.
With OpenSSL 3.5 or later, the selected signature algorithms can be retrieved from
SSL sockets via `socket.client_sigalg()` and `socket.server_sigalg()`.
This commit also partially amends 377b787618
by using `PyUnicode_DecodeFSDefault` instead of `PyUnicode_DecodeASCII` in
`_ssl._SSLContext.get_groups`, so that functions consistently decode strings
obtained from OpenSSL.
---------
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Some common tests in `test.list_tests.CommonTest` explicitly tested `list`
instead of testing the underlying list-like type defined in `type2test`.
---------
Co-authored-by: Devansh Baghla <devanshbaghla34@gmail.com>