Fix the incorrect use of `os.open()` result as a context manager,
while it is actually a numeric file descriptor.
I have missed the problem, because in the original version the
`os.open()` call would always fail, and I failed to test the final
version in all possible scenarios properly.
This is actually an upstream problem in curses, and has been reported
to them already:
https://lists.gnu.org/archive/html/bug-ncurses/2024-09/msg00101.html
This is a nice workaround in the meantime to prevent the segfault.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Previously when executing ``test_functattrs.test___builtins__`` directly, it failed because the fact, that ``__builtins__`` is refers to the built-in module ``builtins`` while it's expects a ``__builtins__.__dict__``. But when this test is being run from another module, then ``__builtins__`` is refers to ``builtins.__dict__``. Now this part of the behaviour is covered.
---------
Co-authored-by: Victor Stinner <vstinner@python.org>
Previously, formatting help output or error message for positional argument
with a tuple metavar raised exception.
Co-authored-by: Cyker Way <cykerway@gmail.com>
It can now have one of three forms:
* basename(argv0) -- for simple scripts
* python arv0 -- for directories, ZIP files, etc
* python -m module -- for imported modules
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
This is to allow the `dataclasses.make_dataclass` infrastructure to be used with another decorator that's compliant with `typing.dataclass_transform`. The new `decorator` argument to `dataclasses.make_dataclass` is `dataclasses.dataclass`, which used to be hard coded.
* Revert "GH-124639: add back loop param to staggered_race (#124700)"
This reverts commit e0a41a5dd1.
* Revert "gh-124309: Modernize the `staggered_race` implementation to support eager task factories (#124390)"
This reverts commit de929f353c.
* gh-124613: Don't run perf tests in JIT builds
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* Apply suggestions from code review
Co-authored-by: Victor Stinner <vstinner@python.org>
---------
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
PR #121089 added an eager import for types.MethodType, but
still left the existing hacks for lazily importing from types.
We could also create MethodType internally in functools.py (e.g.,
by using `type(Placeholder.__repr__)`, but it feels not worth it at
this point, so instead I unlazified all the usages of types in the
module.
Positional arguments with nargs equal to '?' or '*' no longer check
default against choices.
Optional arguments with nargs equal to '?' no longer check const
against choices.
* Setting the __module__ attribute for a class now removes the
__firstlineno__ item from the type's dict.
* The _collections_abc and _pydecimal modules now completely replace the
collections.abc and decimal modules after importing them. This
allows to get the source of classes and functions defined in these
modules.
* inspect.findsource() now checks whether the first line number for a
class is out of bound.
Change the default multiprocessing start method away from fork to forkserver or spawn on the remaining platforms where it was fork. See the issue for context. This makes the default far more thread safe (other than for people spawning threads at import time... - don't do that!).
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>