summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* bpo-38535: Fix positions for AST nodes for calls without arguments in ↵Serhiy Storchaka2019-10-261-2/+4
| | | | decorators. (GH-16861)
* Fix typo in formatter_unicode (GH-16831)Hansraj Das2019-10-251-1/+1
| | | numbers's -> number's
* bpo-38540: Fix possible leak in PyArg_Parse for "es#" and "et#". (GH-16869)Serhiy Storchaka2019-10-211-2/+26
|
* Typo fix - implemention should be implementation (GH-16806)Hansraj Das2019-10-151-1/+1
|
* bpo-11410: Standardize and use symbol visibility attributes across POSIX and ↵Vinay Sajip2019-10-153-15/+16
| | | | Windows. (GH-16347)
* bpo-38469: Handle named expression scope with global/nonlocal keywords ↵Pablo Galindo2019-10-141-3/+9
| | | | | (GH-16755) The symbol table handing of PEP572's assignment expressions is not resolving correctly the scope of some variables in presence of global/nonlocal keywords in conjunction with comprehensions.
* Correct signature of __build_class__ (GH-16735)Pablo Galindo2019-10-131-1/+1
|
* Typo fix: "throuhgh" should be "through". (GH-16704)Hansraj Das2019-10-111-1/+1
|
* bpo-38425: Fix ‘res’ may be used uninitialized warning (GH-16688)Dong-hee Na2019-10-101-1/+2
|
* Typo fix: "empy" should be "empty". (GH-16666)Hansraj Das2019-10-091-1/+1
|
* Fix typo in _warnings.warn_explicit() docstring (GH-16625)Hansraj Das2019-10-081-1/+1
|
* bpo-38353: getpath.c: allocates strings on the heap (GH-16585)Victor Stinner2019-10-041-9/+20
| | | | | | | | | | | * _Py_FindEnvConfigValue() now returns a string allocated by PyMem_RawMalloc(). * calculate_init() now decodes VPATH macro. * Add calculate_open_pyenv() function. * Add substring() and joinpath2() functions. * Fix add_exe_suffix() And a few cleanup changes.
* bpo-38266: Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal ↵Joannah Nanjekye2019-10-041-2/+8
| | | | | (GH-16558) Revert the removal of PyThreadState_DeleteCurrent() with documentation.
* bpo-38353: Add subfunctions to getpath.c (GH-16572)Victor Stinner2019-10-041-4/+6
| | | | | | | | | | | | | | Following symbolic links is now limited to 40 attempts, just to prevent loops. Add subfunctions: * Add resolve_symlinks() * Add calculate_argv0_path_framework() * Add calculate_which() * Add calculate_program_macos() Fix also _Py_wreadlink(): readlink() result type is Py_ssize_t, not int.
* bpo-38353: Cleanup includes in the internal C API (GH-16548)Victor Stinner2019-10-021-0/+1
| | | | Use forward declaration of types to avoid includes in the internal C API. Add also comment to justify other includes.
* bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)Victor Stinner2019-10-015-54/+13
| | | | PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no longer return PyStatus: they cannot fail anymore.
* bpo-38304: Remove PyConfig.struct_size (GH-16500) (GH-16508)Victor Stinner2019-10-016-114/+12
| | | | | | | 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)
* bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)Victor Stinner2019-09-293-45/+85
| | | | | | | | | 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().
* bpo-38310: Predict BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX. (GH-16467)Brandt Bucher2019-09-291-0/+2
|
* bpo-38304: Add PyConfig.struct_size (GH-16451)Victor Stinner2019-09-286-28/+175
| | | | | | | | | | | | | | | | | 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.
* bpo-38234: Py_Initialize() sets global path configuration (GH-16421)Victor Stinner2019-09-262-9/+24
| | | | | | * 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().
* bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402)Victor Stinner2019-09-261-5/+28
| | | | | | | | | | | | * 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-38234: Py_SetPath() uses the program full path (GH-16357)Victor Stinner2019-09-241-4/+7
| | | | | | | 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().
* bpo-38234: Fix _PyConfig_InitPathConfig() (GH-16335)Victor Stinner2019-09-231-149/+166
| | | | | | | | | | | | | | | | * _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.
* bpo-38236: Fix init_dump_ascii_wstr() (GH-16333)Victor Stinner2019-09-231-0/+1
| | | Add missing "return;" (to not dereference NULL pointer).
* bpo-38236: Dump path config at first import error (GH-16300)Victor Stinner2019-09-231-2/+97
| | | | Python now dumps path configuration if it fails to import the Python codecs of the filesystem and stdio encodings.
* Shorter docstring (GH-16322)Raymond Hettinger2019-09-212-4/+4
|
* bpo-38237: Make pow's arguments have more descriptive names and be keyword ↵Ammar Askar2019-09-212-26/+32
| | | | | | | | | | | | passable (GH-16302) Edit: `math.pow` changes removed on Mark's request. https://bugs.python.org/issue38237 Automerge-Triggered-By: @rhettinger
* bpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298)Victor Stinner2019-09-201-0/+7
| | | | | | * 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).
* bpo-38234: Remove _PyPathConfig.dll_path (GH-16307)Victor Stinner2019-09-202-64/+45
| | | | | | | | | 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.
* bpo-38140: Make dict and weakref offsets opaque for C heap types (#16076)Eddie Elizondo2019-09-191-2/+7
| | | | | | * Make dict and weakref offsets opaque for C heap types * Add news
* bpo-38070: Py_FatalError() logs runtime state (GH-16246)Victor Stinner2019-09-171-26/+59
|
* bpo-38070: Add _PyRuntimeState.preinitializing (GH-16245)Victor Stinner2019-09-171-3/+8
| | | | | | Add _PyRuntimeState.preinitializing field: set to 1 while Py_PreInitialize() is running. _PyRuntimeState: rename also pre_initialized field to preinitialized.
* bpo-38070: _Py_DumpTraceback() writes <no Python frame> (GH-16244)Victor Stinner2019-09-171-5/+8
| | | | | When a Python thread has no frame, _Py_DumpTraceback() and _Py_DumpTracebackThreads() now write "<no Python frame>", rather than writing nothing.
* Fix leaks in Python-ast.c (#16127)Eddie Elizondo2019-09-141-1/+5
|
* bpo-37206: Unrepresentable default values no longer represented as None. ↵Serhiy Storchaka2019-09-146-13/+13
| | | | | | | (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.
* Cut disused recode_encoding logic in _PyBytes_DecodeEscape. (GH-16013)Greg Price2019-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* bpo-38138: Fix memory leak introduced by interned strings (GH-16053)Dino Viehland2019-09-121-0/+1
| | | | | | | | | | | Interned string needs to be decref'd https://bugs.python.org/issue38138 Automerge-Triggered-By: @matrixise
* Revert "Fix depth-first-search computation in compile.c (GH-16042)" (GH-16050)T. Wouters2019-09-121-24/+30
| | | | | This reverts commit 355f3e1e5caf16198255df573a1f5e8b98b30105. bpo-38135
* Fix depth-first-search computation in compile.c (GH-16042)Mark Shannon2019-09-121-30/+24
|
* bpo-38121: Sync importlib.metadata with 0.22 backport (GH-15993)Jason R. Coombs2019-09-121-1032/+912
| | | | | | * bpo-38121: Sync importlib.metadata with 0.22 backport * 📜🤖 Added by blurb_it.
* closes bpo-38124: Fix bounds check in PyState_AddModule. (GH-16007)Benjamin Peterson2019-09-111-8/+6
| | | | | 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.
* bpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)Dino Viehland2019-09-111-1388/+2462
| | | 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).
* bpo-35923: Update the BuiltinImporter to use loader._ORIGIN instead of a ↵Dong-hee Na2019-09-111-754/+755
| | | | | | hard-coded value (GH-15651)
* bpo-38113: Update Python/ast.c to PEP-384 (GH-15975)Dino Viehland2019-09-111-4/+3
| | | | | | | | | | 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 (GH-15895)Raymond Hettinger2019-09-112-7/+7
| | | | | | | | * bpo-38096: Clean up the "struct sequence" / "named tuple" docs * Fix remaining occurrences of "struct sequence" * Repair a user visible docstring
* bpo-35943: Prevent PyImport_GetModule() from returning a ↵Joannah Nanjekye2019-09-111-23/+46
| | | | partially-initialized module (GH-15057)
* bpo-37151: remove special case for PyCFunction from PyObject_Call (GH-14684)Jeroen Demeyer2019-09-111-1/+1
| | | | | | | 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.
* bpo-37409: fix relative import with no parent (#14956)Ben Lewis2019-09-111-11/+13
| | | | | | | | | | | | | 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.
* bpo-37752: Delete redundant Py_CHARMASK in normalizestring() (GH-15095)Jordon Xu2019-09-103-7/+7
|