When inverting a Flag member (or boundary STRICT), only consider other canonical flags; when inverting an IntFlag member (or boundary KEEP), also consider aliases.
(cherry picked from commit 59f009e589)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
gh-102541: Fix Helper.help("mod") for non-existent mod (GH-105934)
If the output arg to Helper() is a stream rather than the default None, which means 'page to stdout', the ImportError from pydoc.resolve is currently not caught in pydoc.doc. The same error is caught when output is None.
---------
(cherry picked from commit 0530f4f646)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-101634: regrtest reports decoding error as failed test (#106169)
When running the Python test suite with -jN option, if a worker stdout
cannot be decoded from the locale encoding report a failed testn so the
exitcode is non-zero.
(cherry picked from commit 2ac3eec103)
GH-105840: Fix assertion failures when specializing calls with too many __defaults__ (GH-105847)
(cherry picked from commit 2beab5bdef)
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
gh-105436: The environment block should end with two null wchar_t values (GH-105495)
(cherry picked from commit 4f7d3b602d)
Co-authored-by: Dora203 <66343334+sku2000@users.noreply.github.com>
test_func_return_too_large_int() was defined twice.
Keep only the redefined method, as that also checks the tracebacks.
(cherry picked from commit b8fa7bda4f)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Fix test_importlib.test_side_effect_import() (GH-104840)
Wait until the thread spawn by the import completes to avoid dangling
threads. With this fix, the following command no longer fails:
./python -m test --fail-env-changed test_importlib -m test_side_effect_import -F -j20
(cherry picked from commit 426950993f)
Co-authored-by: Victor Stinner <vstinner@python.org>
In particular, it's important to test that is_typeddict(TypedDict)
returns False.
(cherry picked from commit 1497607a8e)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
[3.12] gh-104271: Fix auto() fallback in case of mixed type Enum (GH-104279)
(cherry picked from commit f4e2049f14)
Co-authored-by: Itamar Ostricher <itamarost@gmail.com>
* gh-103606: Improve error message from logging.config.FileConfig (GH-103628)
(cherry picked from commit 152227b569)
plus backport the followup exception change fix to that in #104701
gh-104472: Skip `test_subprocess.ProcessTestCase.test_empty_env` if ASAN is enabled (GH-104667)
Skip test_subprocess.ProcessTestCase.test_empty_env if ASAN is enabled.
(cherry picked from commit c3f43bfb4b)
Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
Utilize new functions termios.tcgetwinsize() and termios.tcsetwinsize in test_pty.py.
(cherry picked from commit da2fb92643)
Co-authored-by: Soumendra Ganguly <67527439+8vasu@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-104629: Don't skip test_clinic if _testclinic is missing (GH-104630)
Just skip the tests that depend on the _testclinic extension module;
we can still run the Python tests.
(cherry picked from commit 86ee49f469)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
During the PEP 695 implementation at one point I made
TypeVar.__name__ return garbage, and all of test_typing passed.
So I decided to add a few more tests.
(cherry picked from commit 26931944dd)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Fix Zip64 extensions not being properly applied in some cases:
Fixes an issue where adding a small file to a `ZipFile`
object while forcing zip64 extensions causes an extra Zip64 record to be
added to the zip, but doesn't update the `min_version` or file sizes in
the primary central directory header.
Also fixed an edge case in checking if zip64 extensions are required:
This fixes an issue where if data requiring zip64 extensions was added
to an unseekable stream without specifying `force_zip64=True`, zip64
extensions would not be used and a RuntimeError would not be raised when
closing the file (even though the size would be known at that point).
This would result in successfully writing corrupt zip files.
Deciding if zip64 extensions are required outside of the `FileHeader`
function means that both `FileHeader` and `_ZipWriteFile` will always be
in sync. Previously, the `FileHeader` function could enable zip64
extensions without propagating that decision to the `_ZipWriteFile`
class, which would then not correctly write the data descriptor record
or check for errors on close.
If anyone is actually using `ZipInfo.FileHeader` as a public API without
explicitly passing True or False in for zip64, their own code may still be
susceptible to that kind of bug unless they make a similar change to
where the zip64 decision happens.
Fixes GH-103861
---------
.
(cherry picked from commit 798bcaa1eb)
Co-authored-by: Carey Metcalfe <carey@cmetcalfe.ca>
gh-75367: Fix data descriptor detection in inspect.getattr_static (GH-104517)
(cherry picked from commit 5e9f471e7d)
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
GH-71383: IDLE - Document testing subsets of modules (GH-104463)
(cherry picked from commit 080a596152)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-103204: `http.server` - Enforce that HTTP version numbers must consist only of digits (GH-103205)
Reject HTTP requests with invalid http/x.y version numbers: x or y being non-digits or too-long.
---------
(cherry picked from commit cf720acfcb)
Co-authored-by: Ben Kallus <49924171+kenballus@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Fix issue where `pathlib.Path.glob()` raised `OSError` when it encountered
a symlink to an overly long path.
(cherry picked from commit a33ce66dca)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
gh-103247: clear the module cache in a test in test_importlib/extensions/test_loader.py (GH-104226)
(cherry picked from commit 22f3425c3d)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
gh-103848: Adds checks to ensure that bracketed hosts found by urlsplit are of IPv6 or IPvFuture format (GH-103849)
* Adds checks to ensure that bracketed hosts found by urlsplit are of IPv6 or IPvFuture format
---------
(cherry picked from commit 29f348e232)
Co-authored-by: JohnJamesUtley <81572567+JohnJamesUtley@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-103193: Improve `getattr_static` test coverage (GH-104286)
(cherry picked from commit 921185ed05)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>