| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
deprecation warning (GH-17540)
|
|
|
|
|
| |
standard macros (GH-15385)
Use standard constants LLONG_MIN, LLONG_MAX and ULLONG_MAX.
|
| |
|
|
|
|
| |
Remove PyUnicode_ClearFreeList() function: the Unicode free list has
been removed in Python 3.3.
|
|
|
| |
setattrofunc returns `int`, not `PyObject *`.
|
|
|
|
|
|
|
|
| |
Fixed an incorrect sentence in Doc/c-api/mapping.rst I fell on
while translating the file.
skip issue
Automerge-Triggered-By: @csabella
|
|
|
|
| |
Make it a constant and referring to a constant string.
|
|
|
|
|
|
| |
The C-API docs are a bit sparse on the interplay between C `fork()` and the CPython runtime. This change adds some more information on the subject.
https://bugs.python.org/issue38816
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CC @encukou
I'm also adding Petr Viktorin as contributor for vectorcall in the "what's new" section.
https://bugs.python.org/issue36974
Automerge-Triggered-By: @encukou
Automerge-Triggered-By: @encukou
|
|
|
|
|
|
|
|
|
|
|
| |
bpo-3605, bpo-38733: Optimize _PyErr_Occurred(): remove "tstate ==
NULL" test.
Py_FatalError() no longer calls PyErr_Occurred() if called without
holding the GIL. So PyErr_Occurred() no longer has to support
tstate==NULL case.
_Py_CheckFunctionResult(): use directly _PyErr_Occurred() to avoid
explicit "!= NULL" test.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Additional note: the `method_check_args` function in `Objects/descrobject.c` is written in such a way that it applies to all kinds of descriptors. In particular, a future re-implementation of `wrapper_descriptor` could use that code.
CC @vstinner @encukou
https://bugs.python.org/issue37645
Automerge-Triggered-By: @encukou
|
|
|
|
|
|
|
|
|
|
| |
Provide Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as
regular functions for the limited API. Previously, there were defined
as macros, but these macros didn't work with the limited API which
cannot access PyThreadState.recursion_depth field.
Remove _Py_CheckRecursionLimit from the stable ABI.
Add Include/cpython/ceval.h header file.
|
|
|
|
|
| |
This was never intented to be called manually from PyInit_*.
Also, clarify PyState_RemoveModule return value.
|
|
|
| |
Also fix some other formatting.
|
|
|
|
| |
Replace all *NULL* with ``NULL``.
|
| |
|
| |
|
|
|
|
|
| |
(GH-16558)
Revert the removal of PyThreadState_DeleteCurrent() with documentation.
|
|
|
|
| |
PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no
longer return PyStatus: they cannot fail anymore.
|
|
|
|
|
|
|
| |
For now, we'll rely on the fact that the config structures aren't covered by the stable ABI.
We may revisit this in the future if we further explore the idea of offering a stable embedding API.
(cherry picked from commit bdace21b769998396d0ccc8da99a8ca9b507bfdf)
|
|
|
|
|
|
|
|
|
| |
Fix warnings options priority: PyConfig.warnoptions has the highest
priority, as stated in the PEP 587.
* Document options order in PyConfig.warnoptions documentation.
* Make PyWideStringList_INIT macro private: replace "Py" prefix
with "_Py".
* test_embed: add test_init_warnoptions().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new struct_size field to PyPreConfig and PyConfig structures to
allow to modify these structures in the future without breaking the
backward compatibility.
* Replace private _config_version field with public struct_size field
in PyPreConfig and PyConfig.
* Public PyPreConfig_InitIsolatedConfig() and
PyPreConfig_InitPythonConfig()
return type becomes PyStatus, instead of void.
* Internal _PyConfig_InitCompatConfig(),
_PyPreConfig_InitCompatConfig(), _PyPreConfig_InitFromConfig(),
_PyPreConfig_InitFromPreConfig() return type becomes PyStatus,
instead of void.
* Remove _Py_CONFIG_VERSION
* Update the Initialization Configuration documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As mentioned in the bpo ticket, this mistake came up on two reviews:
- https://github.com/python/cpython/pull/16127#pullrequestreview-288312751
- https://github.com/python/cpython/pull/16071#pullrequestreview-287819525
Would be nice to have it documented in a more permanent place than 3.8's whatsnew entry.
https://bugs.python.org/issue38206
Automerge-Triggered-By: @encukou
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add test_embed.test_init_setpath_config(): test Py_SetPath()
with PyConfig.
* test_init_setpath() and test_init_setpythonhome() no longer call
Py_SetProgramName(), but use the default program name.
* _PyPathConfig: isolated, site_import and base_executable
fields are now only available on Windows.
* If executable is set explicitly in the configuration, ignore
calculated base_executable: _PyConfig_InitPathConfig() copies
executable to base_executable.
* Complete path config documentation.
|
|
|
|
|
|
| |
bpo-38140: Document offsets in PyMemberDef
Co-Authored-By: Ammar Askar <ammar_askar@hotmail.com>
|
|
|
|
|
|
|
| |
Py_SetPath() now sets sys.executable to the program full path
(Py_GetProgramFullPath()), rather than to the program name
(Py_GetProgramName()).
Fix also memory leaks in pathconfig_set_from_config().
|
|
|
|
| |
Python now dumps path configuration if it fails to import the Python
codecs of the filesystem and stdio encodings.
|
|
|
|
|
|
| |
* Make dict and weakref offsets opaque for C heap types
* Add news
|
|
|
|
| |
(GH-16142)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Three internal cpython events were not documented, yet.
Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue37363
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a note to the PyModule_AddObject docs.
* Correct example usages of PyModule_AddObject.
* Whitespace.
* Clean up wording.
* 📜🤖 Added by blurb_it.
* First code review.
* Add < 0 in the tests with PyModule_AddObject
|
|
|
| |
https://bugs.python.org/issue37698
|
|
|
|
|
|
|
| |
https://bugs.python.org/issue37750
Automerge-Triggered-By: @matrixise
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- drop TargetScopeError in favour of raising SyntaxError directly
as per the updated PEP 572
- comprehension iteration variables are explicitly local, but
named expression targets in comprehensions are nonlocal or
global. Raise SyntaxError as specified in PEP 572
- named expression targets in the outermost iterable of a
comprehension have an ambiguous target scope. Avoid resolving
that question now by raising SyntaxError. PEP 572
originally required this only for cases where the bound name
conflicts with the iteration variable in the comprehension,
but CPython can't easily restrict the exception to that case
(as it doesn't know the target variable names when visiting
the outermost iterator expression)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are plenty of legitimate scripts in the tree that begin with a
`#!`, but also a few that seem to be marked executable by mistake.
Found them with this command -- it gets executable files known to Git,
filters to the ones that don't start with a `#!`, and then unmarks
them as executable:
$ git ls-files --stage \
| perl -lane 'print $F[3] if (!/^100644/)' \
| while read f; do
head -c2 "$f" | grep -qxF '#!' \
|| chmod a-x "$f"; \
done
Looking at the list by hand confirms that we didn't sweep up any
files that should have the executable bit after all. In particular
* The `.psd` files are images from Photoshop.
* The `.bat` files sure look like things that can be run.
But we have lots of other `.bat` files, and they don't have
this bit set, so it must not be needed for them.
Automerge-Triggered-By: @benjaminp
|
|
|
|
| |
Implement PyBuffer_SizeFromFormat() function (previously
documented but not implemented): call struct.calcsize().
|
| |
|
|
|
|
|
|
|
|
| |
The fact that keyword names are strings is now part of the vectorcall and `METH_FASTCALL` protocols. The biggest concrete change is that `_PyStack_UnpackDict` now checks that and raises `TypeError` if not.
CC @markshannon @vstinner
https://bugs.python.org/issue37540
|
| |
|
| |
|