If OpenSSL was built without PSK support, the python TLS-PSK
methods will raise "NotImplementedError" if called.
Add a constant "ssl.HAS_PSK" to check if TLS-PSK is supported
The `activate` script calls `hash -r` in two places to make sure the shell picks
up the environment changes the script makes. Before that, it checks to
see if the shell running the script is bash or zsh.
`hash -r` is specified by POSIX and is not exclusive to bash and zsh.
This guard prevents the script from calling `hash -r` in other
`#!/bin/sh`-compatible shells like dash.
Prevents a segmentation fault in registered hooks for the readline library, but only when the readline module is loaded inside an isolated sub interpreter. The module is single-phase init so loading it fails, but not until the module init function has already run, where the readline hooks get registered.
The readlinestate_global macro was error-prone to PyImport_FindModule returning NULL and crashing in about 18 places. I could reproduce 1 easily, but this PR replaces the macro with a function and adds error conditions to the other functions.
Protocol in the address tuple should *not* be in the network-byte-order, because it is converted internally[1].
[1] 89ddea4886/Modules/socketmodule.c (L2144)
network byte order doesn't make sense for a python level int anyways. It's a fixed size C serialization concept.
* bpo-32731: Raise OSError from any failure in getpass.getuser()
Previously, if the username was not set in certain environment variables, ImportError escaped on Windows systems, and it was possible for KeyError to escape on other systems if getpwuid() failed.
Add support for TLS-PSK (pre-shared key) to the ssl module.
---------
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Revert commit c8c0afc713 (PR #94532),
which moved `struct.Struct` initialisation from `Struct.__init__` to `Struct.__new__`.
This caused issues with code in the wild that subclasses `struct.Struct`.
* Fix Sphinx warning in library/xml.rst
Direct use of the pyexpat module is deprecated, but this is how to check the version for security purposes
* Fix Sphinx warning in library/importlib.resources.rst
* Use italics for parameters
* Link to the exception
* Fix Sphinx warning in library/gzip.rst
* Document message and header defect base classes to fix Sphinx warning in library/email.headerregistry.rst
* Restore feed_eof() doc to fix Sphinx warning in library/asyncio-stream.rst
* Fix Sphinx warning in extending/newtypes.rst
* Fix Sphinx warning in c-api/set.rst
On stdtypes.rst, set and frozenset are documented together and the frozenset has the working refs
* Fix Sphinx warnings in library/doctest.rst
* Don't link to self, and wrap a line
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Link to load_tests protocol
* Link to option flags
* Wrap line
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
---------
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>