| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Also, reword the What's New messages: this doesn't change the limited API, it only brings the Py_LIMITED_API macro closer to the ideal of only allowing the limited API.
Automerge-Triggered-By: GH:encukou
|
| |
|
|
|
|
|
|
|
| |
Since v8.6.11, a few configuration options seem to accept an empty value
where they did not previously; particularly the `type` of a `Menu`
widget, and the `compound` of any ttk widget with a label. Providing an
explicit expected error message to `checkEnumParam` bypasses the check
of an empty value, which no longer raises `TclError`.
|
| |
|
|
|
|
|
|
|
|
| |
Added non parallel-safe :func:`~contextlib.chdir` context manager to change
the current working directory and then restore it on exit. Simple wrapper
around :func:`~os.chdir`.
Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-29034)
In Python 3.8 and 3.9, stacking `@functools.singledispatchmethod` on top of
`@classmethod` or `@staticmethod` caused an exception to be raised if the
method was registered using type-annotations rather than
`@method.register(int)`. This was not caught by unit tests, however, as the
tests only tested the `@method.register(int)` way of registering additional
implementations. The bug is no longer present in Python 3.10+, but
`test_functools.py` is still lacking regression tests for these cases. This
commit adds these test cases.
|
|
|
|
|
|
|
| |
(gh-29063)
In gh-28954 I adjusted how test_embed determines if it should be skipped. That broke out-of-tree builds. This change fixes them.
https://bugs.python.org/issue45506
|
|
|
|
|
|
|
|
|
|
|
|
| |
continuation characters (GH-28993)
There are two errors that this commit fixes:
* The parser was not correctly computing the offset and the string
source for E_LINECONT errors due to the incorrect usage of strtok().
* The parser was not correctly unwinding the call stack when a tokenizer
exception happened in rules involving optionals ('?', [...]) as we
always make them return valid results by using the comma operator. We
need to check first if we don't have an error before continuing.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Generate test classes at import time. It allows to filter them when
run with unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
* Create a database class in a new directory which will be removed after
test. It guarantees that all created files and directories be removed
and will not conflict with other dbm tests.
* Restore dbm._defaultmod after tests. Previously it was set to the last
dbm module (dbm.dumb) which affected other tests.
* Enable the whichdb test for dbm.dumb.
* Move test_keys to the correct test class. It does not test whichdb().
* Remove some outdated code and comments.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
get_terminal_size (GH-29046)
I considered only falling back when both were 0, but that still seems
wrong, and the highly popular rich[1] library does it this way, so I
thought we should probably inherit that behavior.
[1] https://github.com/willmcgugan/rich
Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
| |
|
| |
|
|
|
|
|
| |
Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
|
|
|
|
|
| |
We should have done this way back when 3.9 was released, but it fell off
the radar.
Co-authored-by: Paul Ganssle <git@m.ganssle.io>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
The Python 3.11 limited C API no longer includes stdlib.h, stdio.h,
string.h and errno.h.
* Exclude Py_MEMCPY() from Python 3.11 limited C API.
* xxlimited C extension is now built with Python 3.11 limited C API.
|
|
|
|
|
| |
LZMAFile. (GH-29016)
This reverts commit d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e.
|
|
|
|
|
|
|
| |
(GH-29045)
I think this makes the documentation much more digestible :)
Signed-off-by: Filipe Laíns <lains@riseup.net>
|
|
|
|
|
|
|
|
|
|
| |
Move Include/longobject.h non-limited API to a new
Include/cpython/longobject.h header file.
Move the following definitions to the internal C API:
* _PyLong_DigitValue
* _PyLong_FormatAdvancedWriter()
* _PyLong_FormatWriter()
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Split header files to move the non-limited API to Include/cpython/:
* Include/warnings.h => Include/cpython/warnings.h
* Include/weakrefobject.h => Include/cpython/weakrefobject.h
Exclude PyWeakref_GET_OBJECT() from the limited C API. It never
worked since the PyWeakReference structure is opaque in the limited C
API.
Move _PyWarnings_Init() and _PyErr_WarnUnawaitedCoroutine() to the
internal C API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-45516: add protocol description to the Traversable documentation
Signed-off-by: Filipe Laíns <lains@riseup.net>
* Update Doc/library/importlib.rst
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* Update Lib/importlib/abc.py
* Update Doc/library/importlib.rst
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
|
| |
|
|
|
|
|
|
| |
* Rename _PyThreadState_DisableTracing()
to _PyThreadState_PauseTracing()
* Rename _PyThreadState_ResetTracing()
to _PyThreadState_ResumeTracing()
|
|
|
|
|
|
| |
* Avoid making C calls for most calls to Python functions.
* Change initialize_locals(steal=true) and _PyTuple_FromArraySteal to consume the argument references regardless of whether they succeed or fail.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Since the keyword list is frozen, only compute it once per
session. The colorizer already handles context keywords.
|
|
|
|
|
|
|
| |
(gh-28940)
The default was "off". Switching it to "on" means users get the benefit of frozen stdlib modules without having to do anything. There's a special-case for running-in-source-tree, so contributors don't get surprised when their stdlib changes don't get used.
https://bugs.python.org/issue45020
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
The global statement allows specifying a list of identifiers
(https://docs.python.org/3/reference/simple_stmts.html#the-global-statement).
The "Execution model" chapter described the global statement as if it
only allowed one single name. Pluralize "name" in the appropriate places.
|
|
|
|
|
|
|
| |
@vsajip Sorry for the trouble—made a [fairly significant] git error in the previous PR.
Have edited the patch as you had said in #28959.
Automerge-Triggered-By: GH:vsajip
|
|
|
|
|
|
|
|
| |
Remove fallbacks for missing round(), copysign() and hypot() in
Python/pymath.c. Python now requires these functions to build.
These fallbacks were needed on Visual Studio 2012 and older. They are
no longer needed since Visual Stuido 2013. Python is now built with
Visual Studio 2017 or newer since Python 3.6.
|
|
|
|
|
|
|
|
| |
Convert the result of macros setting variables to void to avoid risks
of misusing them:
* _PyGCHead_SET_NEXT()
* asdl_seq_SET()
* asdl_seq_SET_UNTYPED()
|
|
|
|
|
|
|
|
|
|
| |
Add PyThreadState_EnterTracing() and PyThreadState_LeaveTracing()
functions to the limited C API to suspend and resume tracing and
profiling.
Add an unit test on the PyThreadState C API to _testcapi.
Add also internal _PyThreadState_DisableTracing() and
_PyThreadState_ResetTracing().
|
|
|
|
|
|
|
|
|
| |
Rename Include/namespaceobject.h to
Include/internal/pycore_namespace.h.
The _testmultiphase extension is now built with the
Py_BUILD_CORE_MODULE macro defined to access _PyNamespace_Type.
object.c: remove unused "pycore_context.h" include.
|
| |
|
| |
|
|
|
|
| |
Move Include/eval.h content into Include/ceval.h and
Include/cpython/ceval.h, and remove Include/eval.h.
|
|
|
|
| |
Move the interpreteridobject.h header file from Include/ to
Include/internal/. It only provides private functions.
|
|
|
| |
Strip trailing '\n'.
|
|
|
|
|
|
|
|
|
| |
Move classobject.h, context.h, genobject.h and longintrepr.h header
files from Include/ to Include/cpython/.
Remove redundant "#ifndef Py_LIMITED_API" in context.h.
Remove explicit #include "longintrepr.h" in C files. It's not needed,
Python.h already includes it.
|
|
|
| |
Thank you to Eryk Sun for the suggestions in https://github.com/python/cpython/pull/28965#discussion_r729527143.
|