summaryrefslogtreecommitdiff
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* 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-181-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-121-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
|
* bpo-38086: Sync importlib.metadata with importlib_metadata 0.21. (GH-15840)Jason R. Coombs2019-09-101-613/+612
| | | https://gitlab.com/python-devs/importlib_metadata/-/tags/0.21
* bpo-38090: Fix reference leak in ceval.c (GH-15848)Pablo Galindo2019-09-101-1/+0
|
* bpo-36781: Optimize sum() for bools. (#13074)Serhiy Storchaka2019-09-101-2/+2
| | | | | | | | * Optimize sum() for bools. * Fix sum([], False). * Add a NEWS entry.
* bpo-38068: Clean up gettimeofday configure logic. (GH-15775)Benjamin Peterson2019-09-102-12/+1
| | | Assume gettimeofday exists and takes two arguments.
* bpo-38083: Minor improvements in asdl_c.py and Python-ast.c. (GH-15824)Serhiy Storchaka2019-09-101-131/+307
| | | | | * Use the const qualifier for constant C strings. * Intern field and attribute names. * Temporary incref a borrowed reference to a list item.
* bpo-20490: Improve circular import error message (GH-15308)Anthony Sottile2019-09-091-4/+11
|
* bpo-15088 : Remove PyGen_NeedsFinalizing() (GH-15702)Joannah Nanjekye2019-09-061-5/+0
| | | | | Remove PyGen_NeedsFinalizing(): it was not documented, tested or used anywhere within CPython after the implementation of PEP 442.
* bpo-37878: Remove PyThreadState_DeleteCurrent() function (GH-15315)Joannah Nanjekye2019-09-051-9/+3
| | | | | | | * Rename PyThreadState_DeleteCurrent() to _PyThreadState_DeleteCurrent() * Move it to the internal C API Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
* bpo-15999: Clean up of handling boolean arguments. (GH-15610)Serhiy Storchaka2019-09-012-15/+9
| | | | | | * 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.
* bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630)Serhiy Storchaka2019-09-012-14/+8
| | | Only AttributeError should be silenced.
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-302-3/+3
|
* bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592)Sergey Fedoseev2019-08-291-4/+0
|
* bpo-37034: Display argument name on errors with keyword arguments with ↵Rémi Lapeyre2019-08-296-33/+27
| | | | Argument Clinic. (GH-13593)
* bpo-37947: Avoid double-decrement in symtable recursion counting (GH-15593)Nick Coghlan2019-08-291-4/+14
| | | | | | | | | 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.
* bpo-23878: Remove an unneeded fseek() call in _Py_FindEnvConfigValue() ↵Zackery Spytz2019-08-281-1/+0
| | | | (GH-15424)
* Fix unused variable and signed/unsigned warnings (GH-15537)Raymond Hettinger2019-08-272-3/+3
|
* Make PyXXX_Fini() functions private (GH-15531)Victor Stinner2019-08-271-12/+12
| | | | | For example, rename PyTuple_Fini() to _PyTuple_Fini(). These functions are only declared in the internal C API.
* bpo-37954: Fix reference leak in the symtable (GH-15514)Pablo Galindo2019-08-261-1/+3
|
* bpo-37947: Adjust correctly the recursion level in symtable for named ↵Pablo Galindo2019-08-261-1/+3
| | | | expressions (GH-15499)
* bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15131)Nick Coghlan2019-08-251-24/+97
| | | | | | | | | | | | | | | - 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)
* bpo-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)Zackery Spytz2019-08-256-2623/+2622
| | | | Fix assert statement misbehavior if AssertionError is shadowed.
* bpo-37942: Improve argument clinic float converter (GH-15470)Raymond Hettinger2019-08-242-6/+12
|
* bpo-37830: Fix compilation of break and continue in finally. (GH-15320)Serhiy Storchaka2019-08-244-180/+224
| | | | | | Fix compilation of "break" and "continue" in the "finally" block when the corresponding "try" block contains "return" with a non-constant value.
* bpo-29535: Remove promize about hash randomization of datetime objects. ↵Serhiy Storchaka2019-08-241-2/+2
| | | | (GH-15269)
* bpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)Zackery Spytz2019-08-231-1/+8
|
* bpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431)Victor Stinner2019-08-232-30/+45
| | | | | | | | | | PyConfig_Read() is now responsible to handle early calls to PySys_AddXOption() and PySys_AddWarnOption(). Options added by PySys_AddXOption() are now handled the same way than PyConfig.xoptions and command line -X options. For example, PySys_AddXOption(L"faulthandler") enables faulthandler as expected.
* bpo-36763: Implement PyWideStringList_Insert() of PEP 587 (GH-15423)Victor Stinner2019-08-231-4/+25
|
* bpo-37926: Fix PySys_SetArgvEx(0, NULL, 0) crash (GH-15415)Victor Stinner2019-08-231-1/+1
| | | | | | | | | | empty_argv is no longer static in Python 3.8, but it is declared in a temporary scope, whereas argv keeps a reference to it. empty_argv memory (allocated on the stack) is reused by make_sys_argv() code which is inlined when using gcc -O3. Define empty_argv in PySys_SetArgvEx() body, to ensure that it remains valid for the whole lifetime of the PySys_SetArgvEx() call.
* bpo-37834: Normalise handling of reparse points on Windows (GH-15231)Steve Dower2019-08-211-1/+6
| | | | | | | | | | bpo-37834: Normalise handling of reparse points on Windows * ntpath.realpath() and nt.stat() will traverse all supported reparse points (previously was mixed) * nt.lstat() will let the OS traverse reparse points that are not name surrogates (previously would not traverse any reparse point) * nt.[l]stat() will only set S_IFLNK for symlinks (previous behaviour) * nt.readlink() will read destinations for symlinks and junction points only bpo-1311: os.path.exists('nul') now returns True on Windows * nt.stat('nul').st_mode is now S_IFCHR (previously was an error)
* bpo-37751: Fix codecs.lookup() normalization (GH-15092)Jordon Xu2019-08-211-16/+16
| | | | | Fix codecs.lookup() to normalize the encoding name the same way than encodings.normalize_encoding(), except that codecs.lookup() also converts the name to lower case.