Add tests for 'self' and 'defining_class' converter requirements.
(cherry picked from commit 7f4c8121db)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
gh-91053: make func watcher tests resilient to other func watchers (GH-106286)
(cherry picked from commit 58906213cc)
Co-authored-by: Carl Meyer <carl@oddbird.net>
gh-106359: Fix corner case bugs in Argument Clinic converter parser (GH-106361)
DSLParser.parse_converter() could return unusable kwdicts in some rare cases
(cherry picked from commit 0da4c883cf)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Replace the esoteric term 'datum' when describing dict comprehensions (GH-106119)
(cherry picked from commit 987b712b4a)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
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-106232: Make timeit doc command lines compatible with Windows. (GH-106296)
Command Prompt (CMD Shell) and older versions of PowerShell
require double quotes and single quotes inside the string.
This form also works on linux and macOS.
(cherry picked from commit 04dfc6fa90)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-105486: Change the `repr` of `ParamSpec` list of args in `GenericAlias` (GH-105488)
(cherry picked from commit eb7d6e7ad8)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Fix possible refleak in CodeType.replace() (GH-106243)
A reference to c_code was leaked if PySys_Audit() failed.
(cherry picked from commit 3c70d467c1)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* EOFError no longer overrides other errors such as MemoryError or OSError at
the start of the object.
* Raise more relevant error when the NULL object occurs as a code object
component.
* Minimize an overhead of calling PyErr_Occurred().
(cherry picked from commit 8bf6904b22)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-106033: Get rid of PyDict_GetItem in _PyFunction_FromConstructor (GH-106044)
(cherry picked from commit 08c08d21b0)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-105993: Add possible `None` return type to `asyncio.EventLoop.start_tls` docs (GH-105995)
(cherry picked from commit 6b52a581c1)
Co-authored-by: Sam Bull <git@sambull.org>
GH-106160: Fix test_gzip failing under WASI, which does not have zlib. (GH-106167)
Fix test_gzip's failure under WASI, which does not have zlib, by using
test.support.import_helper.import_module to import zlib. (gzip
unconditionally imports zlib, so this does not cause any new skips.)
(cherry picked from commit 161012fc25)
Co-authored-by: T. Wouters <thomas@python.org>
Fix c-analyzer for GCC: ignore LANG env var (GH-106173)
The c-analyzer doesn't support GCC localized messages, so just unset
the LANG environment variable.
(cherry picked from commit 1f74b9e933)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-101634: regrtest reports decoding error as failed test (GH-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)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-106140: Reorder some fields to facilitate out-of-process inspection (GH-106143)
(cherry picked from commit 2d5a1c2811)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
IDLE: Condense run.main threading.Thread start. (GH-106125)
Use daemon argument added in 3.3 and directly call .start.
Remove now unused 'sockthread' name.
(cherry picked from commit eaa1eae55e)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Revert "GH-96145: Add AttrDict to JSON module for use with object_hook (GH-96146)" (GH-105948)
This reverts commit 1f0eafa844.
(cherry picked from commit d3af83b934)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
gh-106107: document correct error that's raised when a mutable default value for a field is detected (gh-106109)
(cherry picked from commit 512f299e55)
Co-authored-by: Roderich Schupp <roderich.schupp@gmail.com>
Improve typing docs on the type of class objects (GH-106081)
(cherry picked from commit 3eeb8c8906)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gh-104212: Explain how to port imp.load_source() (GH-105978)
Explain how to port removed imp.load_source() to importlib in What's
New in Python 3.12.
(cherry picked from commit 18a7c86697)
Co-authored-by: Victor Stinner <vstinner@python.org>
Add end-of-file-fixer to pre-commit (GH-106065)
(cherry picked from commit 8c24a83737)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>