| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* Py_InitializeFromConfig() now writes PyConfig path configuration to
the global path configuration (_Py_path_config).
* Add test_embed.test_get_pathconfig().
* Fix typo in _PyWideStringList_Join().
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* _PyConfig_InitPathConfig() now starts by copying the global path
configuration, and then override values set in PyConfig.
* _PyPathConfig_Calculate() implementations no longer override
_PyPathConfig fields which are already computed. For example,
if _PyPathConfig.prefix is not NULL, leave it unchanged.
* If Py_SetPath() has been called, _PyConfig_InitPathConfig() doesn't
call _PyPathConfig_Calculate() anymore.
* _PyPathConfig_Calculate() no longer uses PyConfig,
except to initialize PyCalculatePath structure.
* pathconfig_calculate(): remove useless temporary
"_PyPathConfig new_config" variable.
* calculate_module_search_path(): remove hack to workaround memory
allocation failure, call Py_FatalError() instead.
* Fix get_program_full_path(): handle memory allocation failure.
|
|
|
| |
Add missing "return;" (to not dereference NULL pointer).
|
|
|
|
| |
Python now dumps path configuration if it fails to import the Python
codecs of the filesystem and stdio encodings.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
passable (GH-16302)
Edit: `math.pow` changes removed on Mark's request.
https://bugs.python.org/issue38237
Automerge-Triggered-By: @rhettinger
|
|
|
|
|
|
| |
* If Py_SetPath() has been called, _PyConfig_InitPathConfig() now
uses its value.
* Py_Initialize() now longer copies path configuration from PyConfig
to the global path configuration (_Py_path_config).
|
|
|
|
|
|
|
|
|
| |
The DLL path is not computed from any user configuration and cannot
be configured by PyConfig. Instead, add a new _Py_dll_path global variable.
Remove _PyConfig_SetPathConfig(): replaced with _PyPathConfig_Init().
Py_Initialize() now longer sets the "global path configuration",
but only initialize _Py_dll_path.
|
|
|
|
|
|
| |
* Make dict and weakref offsets opaque for C heap types
* Add news
|
| |
|
|
|
|
|
|
| |
Add _PyRuntimeState.preinitializing field: set to 1 while
Py_PreInitialize() is running.
_PyRuntimeState: rename also pre_initialized field to preinitialized.
|
|
|
|
|
| |
When a Python thread has no frame, _Py_DumpTraceback() and
_Py_DumpTracebackThreads() now write "<no Python frame>", rather than
writing nothing.
|
| |
|
|
|
|
|
|
|
| |
(GH-13933)
In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values
(like in the optional third parameter of getattr). "None" should be used if None is accepted
as argument and passing None has the same effect as not passing the argument at all.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All call sites pass NULL for `recode_encoding`, so this path is
completely untested. That's been true since before Python 3.0.
It adds significant complexity to this logic, so it's best to
take it out.
All call sites now have a literal NULL, and that's been true since
commit 768921cf3 eliminated a conditional (`foo ? bar : NULL`) at
the call site in Python/ast.c where we're parsing a bytes literal.
But even before then, that condition `foo` had been a constant
since unadorned string literals started meaning Unicode, in commit
572dbf8f1 aka v3.0a1~1035 .
The `unicode` parameter is already unused, so mark it as unused too.
The code that acted on it was also taken out before Python 3.0, in
commit 8d30cc014 aka v3.0a1~1031 .
The function (PyBytes_DecodeEscape) is exposed in the API, but it's
never been documented.
|
|
|
|
|
|
|
|
|
|
|
| |
Interned string needs to be decref'd
https://bugs.python.org/issue38138
Automerge-Triggered-By: @matrixise
|
|
|
|
|
| |
This reverts commit 355f3e1e5caf16198255df573a1f5e8b98b30105.
bpo-38135
|
| |
|
|
|
|
|
|
| |
* bpo-38121: Sync importlib.metadata with 0.22 backport
* 📜🤖 Added by blurb_it.
|
|
|
|
|
| |
The >=, checking whether a module index was in already in the module-by-index list, needed to be strict.
Also, fold nested ifs into one and fix some bad spacing.
|
|
|
| |
Summary: This mostly migrates Python-ast.c to PEP384 and removes all statics from the whole file. This modifies the generator itself that generates the Python-ast.c. It leaves in the usage of _PyObject_LookupAttr even though it's not fully PEP384 compatible (this could always be shimmed in by anyone who needs it).
|
|
|
|
|
|
| |
hard-coded value (GH-15651)
|
|
|
|
|
|
|
|
|
|
| |
Removes statics for better subinterpreter support and moves to _PyType_Name
https://bugs.python.org/issue38113
Automerge-Triggered-By: @tiran
|
|
|
|
|
|
|
|
| |
* bpo-38096: Clean up the "struct sequence" / "named tuple" docs
* Fix remaining occurrences of "struct sequence"
* Repair a user visible docstring
|
|
|
|
| |
partially-initialized module (GH-15057)
|
|
|
|
|
|
|
| |
bpo-37151: remove special case for PyCFunction from PyObject_Call
Alse, make the undocumented function PyCFunction_Call an alias
of PyObject_Call and deprecate it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Relative imports use resolve_name to get the absolute target name,
which first seeks the current module's absolute package name from the globals:
If __package__ (and __spec__.parent) are missing then
import uses __name__, truncating the last segment if
the module is a submodule rather than a package __init__.py
(which it guesses from whether __path__ is defined).
The __name__ attempt should fail if there is no parent package (top level modules),
if __name__ is '__main__' (-m entry points), or both (scripts).
That is, if both __name__ has no subcomponents and the module does not seem
to be a package __init__ module then import should fail.
|
| |
|
|
|
| |
https://gitlab.com/python-devs/importlib_metadata/-/tags/0.21
|
| |
|
|
|
|
|
|
|
|
| |
* Optimize sum() for bools.
* Fix sum([], False).
* Add a NEWS entry.
|
|
|
| |
Assume gettimeofday exists and takes two arguments.
|
|
|
|
|
| |
* Use the const qualifier for constant C strings.
* Intern field and attribute names.
* Temporary incref a borrowed reference to a list item.
|
| |
|
|
|
|
|
| |
Remove PyGen_NeedsFinalizing(): it was not
documented, tested or used anywhere within CPython after
the implementation of PEP 442.
|
|
|
|
|
|
|
| |
* Rename PyThreadState_DeleteCurrent()
to _PyThreadState_DeleteCurrent()
* Move it to the internal C API
Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
|
|
|
|
|
|
| |
* Use the 'p' format unit instead of manually called PyObject_IsTrue().
* Pass boolean value instead 0/1 integers to functions that needs boolean.
* Convert some arguments to boolean only once.
|
|
|
| |
Only AttributeError should be silenced.
|
| |
|
| |
|
|
|
|
| |
Argument Clinic. (GH-13593)
|
|
|
|
|
|
|
|
|
| |
With `symtable_visit_expr` now correctly adjusting the recursion depth for named
expressions, `symtable_handle_namedexpr` should be leaving it alone.
Also adds a new check to `PySymtable_BuildObject` that raises `SystemError`
if a successful first symbol analysis pass fails to keep the stack depth
accounting clean.
|
|
|
|
| |
(GH-15424)
|
| |
|
|
|
|
|
| |
For example, rename PyTuple_Fini() to _PyTuple_Fini().
These functions are only declared in the internal C API.
|
| |
|
|
|
|
| |
expressions (GH-15499)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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)
|