Re-arrange `pathlib.Path` test methods in source code. No other changes.
The test methods are arranged in two groups. The first group checks
`stat()`, `open()`, `iterdir()`, `readlink()`, and derived methods like
`exists()`, `read_text()`, `glob()` and `resolve()`. The second group
checks all other `Path` methods. To minimise the diff I've maintained the
method order within groups where possible.
This patch prepares the ground for a new `_AbstractPath` class, which will
support methods in the first group above. By churning the test methods
here, subsequent patches will be easier to review and less likely to break
things.
* Move imports at top level and sort imports.
* Replace c_buffer() with create_string_buffer(): c_buffer is a
deprecated alias.
* PEP 8: Add empty lines for readability between imports and classes.
Remove the @need_symbol('...') decorator of test.test_ctypes since
requested symbols are now always always available in ctypes.
Use the @unittest.skipUnless() decorator directly for the two types
only available on Windows:
* ctypes.WINFUNCTYPE
* ctypes.oledll
test_xmlrpc_net was skipped since 2017:
commit 73ffd3f203.
The public buildbot.python.org server has no XML-RPC interface
anymore, and no replacement server was found in 6 years.
Reimplement _iso8601_format() using the datetime isoformat() method.
Ignore the timezone.
Co-Authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
Deprecate two methods of creating typing.TypedDict classes with 0 fields using the functional syntax: `TD = TypedDict("TD")` and `TD = TypedDict("TD", None)`. Both will be disallowed in Python 3.15. To create a TypedDict class with 0 fields, either use `class TD(TypedDict): pass` or `TD = TypedDict("TD", {})`.
* Add table describing possible executable classes for out-of-process debuggers.
* Remove shim code object creation code as it is no longer needed.
* Make lltrace a bit more robust w.r.t. non-standard frames.
Deprecate creating a typing.NamedTuple class using keyword arguments to denote the fields (`NT = NamedTuple("NT", x=int, y=str)`). This will be disallowed in Python 3.15. Use the class-based syntax or the functional syntax instead.
Two methods of creating `NamedTuple` classes with 0 fields using the functional syntax are also deprecated, and will be disallowed in Python 3.15: `NT = NamedTuple("NT")` and `NT = NamedTuple("NT", None)`. To create a `NamedTuple` class with 0 fields, either use `class NT(NamedTuple): pass` or `NT = NamedTuple("NT", [])`.
Remove compatibility code for Python 2 and early Python 3 versions.
* Remove os_fsencode() reimplementation: use os.fsencode() directly.
os.fsencode() was added to Python 3.2.
* Remove references to Python 2 and "Python 3": just say "Python".
* Remove outdated u'' string format: use '' instead.
Replace #pragma with _Py_COMP_DIAG_PUSH,
_Py_COMP_DIAG_IGNORE_DEPR_DECLS and _Py_COMP_DIAG_POP to ease Python
maintenance. Also add a comment explaining why callbacks.c ignores a
deprecation warning.
The syntax used in the current docs (a / before any args) is invalid.
I think the right approach is for the arguments to arbitrary
filter functions to be treated as positional-only, meaning that users
can supply filter functions with any names for the argument. tarfile.py
only calls the filter function with positional arguments.
test_ctypes now gets attributes specific to Windows from the ctypes
module, rather than relying on "from ctypes import *".
Attributes:
* ctypes.FormatError
* ctypes.WINFUNCTYPE
* ctypes.WinError
* ctypes.WinDLL
* ctypes.windll
* ctypes.oledll
* ctypes.get_last_error()
* ctypes.set_last_error()
This fixes a race during import. The existing _PyRuntimeState.imports.pkgcontext is shared between interpreters, and occasionally this would cause a crash when multiple interpreters were importing extensions modules at the same time. To solve this we add a thread-local variable for the value. We also leave the existing state (and infrequent race) in place for platforms that do not support thread-local variables.
* GH-104554: Add RTSPS support to `urllib/parse.py`
RTSPS is the permanent scheme defined in
https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
alongside RTSP and RTSPU schemes.
* 📜🤖 Added by blurb_it.
---------
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
For a while now, pending calls only run in the main thread (in the main interpreter). This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.