| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
(GH-22395) (GH-23303)
* bpo-39934: backport PR 22395 to 3.9
|
|
|
|
|
|
| |
bpo-41686, bpo-41713: On Windows, the SIGINT event,
_PyOS_SigintEvent(), is now created even if Python is configured to
not install signal handlers (PyConfig.install_signal_handlers=0 or
Py_InitializeEx(0)).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Windows, fix a regression in signal handling which prevented to
interrupt a program using CTRL+C. The signal handler can be run in a
thread different than the Python thread, in which case the test
deciding if the thread can handle signals is wrong.
On Windows, _PyEval_SignalReceived() now always sets eval_breaker to
1 since it cannot test _Py_ThreadCanHandleSignals(), and
eval_frame_handle_pending() always calls
_Py_ThreadCanHandleSignals() to recompute eval_breaker.
(cherry picked from commit d96a7a83133250377219227b5cfab4dbdddc5d3a)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
|
|
|
|
|
|
| |
Use wide-char _W_* fields of lconv structure on Windows
Remove "ps_AF" from test__locale.known_numerics on Windows
(cherry picked from commit f2312037e3a974d26ed3e23884f94c6af111a27a)
Co-authored-by: TIGirardi <tiagoigirardi@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running in a non-UTF-8 locale, if an error occurs while importing a
native Python module (say because a dependent share library is missing),
the error message string returned may contain non-ASCII code points
causing a UnicodeDecodeError.
PyUnicode_DecodeFSDefault is used for buffers which may contain
filesystem paths. For consistency with os.strerror(),
PyUnicode_DecodeLocale is used for buffers which contain system error
messages. While the shortname parameter is always encoded in ASCII
according to PEP 489, it is left decoded using PyUnicode_FromString to
minimize the changes and since it should not affect the decoding (albeit
_potentially_ slower).
In dynload_hpux, since the error buffer contains a message generated
from a static ASCII string and the module filesystem path,
PyUnicode_DecodeFSDefault is used instead of PyUnicode_DecodeLocale as
is used elsewhere.
* bpo-41894: Fix bugs in dynload error msg handling
For both dynload_aix and dynload_hpux, properly handle the possibility
that decoding strings may return NULL and when such an error happens,
properly decrement any previously decoded strings and return early.
In addition, in dynload_aix, ensure that we pass the decoded string
*object* pathname_ob to PyErr_SetImportError instead of the original
pathname buffer.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 2d2af320d94afc6561e8f8adf174c9d3fd9065bc)
Co-authored-by: Kevin Adler <kadler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
* PyMapping_HasKey() is not safe because it silences all exceptions and can return incorrect result.
* Informative exceptions from PyMapping_DelItem() are overridden with RuntimeError and
the original exception raised before calling remove_module() is lost.
* There is a race condition between PyMapping_HasKey() and PyMapping_DelItem().
(cherry picked from commit 8287aadb75f6bd0154996424819334cd3839707c)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
| |
Fix the compiler warning:
format specifies type `wint_t` (aka `int`) but the argument has type `unsigned int`
(cherry picked from commit c322948892438a387d752ec18d1eb512699a4d67)
Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Partially revert commit ac46eb4ad6662cf6d771b20d8963658b2186c48c:
"bpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)".
Using a module state per module instance is causing subtle practical
problems.
For example, the Mercurial project replaces the __import__() function
to implement lazy import, whereas Python expected that "import _ast"
always return a fully initialized _ast module.
Add _PyAST_Fini() to clear the state at exit.
The _ast module has no state (set _astmodule.m_size to 0). Remove
astmodule_traverse(), astmodule_clear() and astmodule_free()
functions..
(cherry picked from commit e5fbe0cbd4be99ced5f000ad382208ad2a561c90)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix GCC 9.3 (using -O3) warnings on x86:
initconfig.c: In function ‘init_dump_ascii_wstr’:
initconfig.c:2679:34: warning: format ‘%lc’ expects argument of type
‘wint_t’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
2679 | PySys_WriteStderr("%lc", ch);
initconfig.c:2682:38: warning: format ‘%x’ expects argument of type
‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
2682 | PySys_WriteStderr("\\x%02x", ch);
initconfig.c:2686:38: warning: format ‘%x’ expects argument of type
‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
2686 | PySys_WriteStderr("\\U%08x", ch);
initconfig.c:2690:38: warning: format ‘%x’ expects argument of type
‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
2690 | PySys_WriteStderr("\\u%04x", ch);
(cherry picked from commit 640e8e1d5f61d5868453d992da04bf4741327748)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
| |
(cherry picked from commit 58de1dd6a8677bd213802c19204b827cb7134695)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
(GH-21850) (GH-22107)
(cherry picked from commit c51db0ea40ddabaf5f771ea633b37fcf4c90a495)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
| |
Free the stack allocated in va_build_stack if do_mkstack fails
and the stack is not a small_stack
(cherry picked from commit 75c80b0bda89debf312f075716b8c467d411f90e)
Co-authored-by: Tony Solomonik <tony.solomonik@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
in format specifier (GH-22036) (GH-22041)
* Fixed `f-string/str.format` error description when using two `,` in format specifier.
Co-authored-by: millefalcon <hanish0019@hmail.com>
(cherry picked from commit 0d6aa7f0ee38eb453bc8f73bf4830e6172be2f35)
Co-authored-by: han-solo <hanish0019@gmail.com>
Co-authored-by: han-solo <hanish0019@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-41194: Convert _ast extension to PEP 489 (GH-21293)
Convert the _ast extension module to PEP 489 "Multiphase
initialization". Replace the global _ast state with a module state.
(cherry picked from commit b1cc6ba73a51d5cc3aeb113b5e7378fb50a0e20a)
* bpo-41204: Fix compiler warning in ast_type_init() (GH-21307)
(cherry picked from commit 1f76453173267887ed05bb3783e862cb22365ae8)
|
|
|
|
|
| |
(cherry picked from commit ea62a4bd54421693ed6b24a1bbd18ebed3bdb8f8)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
|
|
|
|
|
|
|
| |
3.8.3 had a regression where compiling with
ast.PyCF_ALLOW_TOP_LEVEL_AWAIT woudl agressively mark things are
coroutine even if there were not.
(cherry picked from commit bd46174)
Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
|
|
|
|
|
|
|
|
|
| |
is embedded (GH-21297)
Also enables using debug build of `python3_d.dll`
Reference: CVE-2020-15523
(cherry picked from commit dcbaa1b49cd9062fb9ba2b9d49555ac6cd8c60b5)
Co-authored-by: Steve Dower <steve.dower@python.org>
|
|
|
|
| |
before types are cleared (GH-21304)
|
|
|
| |
Co-authored-by: Konge <zkonge@outlook.com>
|
|
|
|
|
| |
(cherry picked from commit d160e0f8e283d0a8737644588b38e8c6a07c134f)
Co-authored-by: tkmikan <36260601+tkmikan@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-21292)
* bpo-41194: Pass module state in Python-ast.c (GH-21284)
Rework asdl_c.py to pass the module state to functions in
Python-ast.c, instead of using astmodulestate_global.
Handle also PyState_AddModule() failure in init_types().
(cherry picked from commit 74419f0c64959bb8392fcf3659058410423038e1)
* bpo-41194: The _ast module cannot be loaded more than once (GH-21290)
Fix a crash in the _ast module: it can no longer be loaded more than
once. It now uses a global state rather than a module state.
* Move _ast module state: use a global state instead.
* Set _astmodule.m_size to -1, so the extension cannot be loaded more
than once.
(cherry picked from commit 91e1bc18bd467a13bceb62e16fbc435b33381c82)
|
|
|
|
| |
(#21022)
|
|
|
|
|
|
| |
(GH-21054) (GH-21190)
This commit changes the parsing of f-string expressions with the new parser. The parser gets pre-fed with the location of the expression itself (not the f-string, which was what we were doing before). This allows us to completely skip the shifting of the AST nodes after the parsing is completed..
(cherry picked from commit 1f0f4abb110b9fbade6175842b6a26ab0b8df6dd)
|
|
|
|
|
|
|
| |
(GH-21183)
(cherry picked from commit 6dcbc2422de9e2a7ff89a4689572d84001e230b2)
Automerge-Triggered-By: @pablogsal
|
|
|
|
|
| |
(cherry picked from commit 6c6810d98979add7a89391c3c38990d0859f7a29)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 4901ea952691ad70aae21cfe04b6bd363b5a6aff)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
|
|
|
| |
(GH-21013)
Reported by Coverity. (CID 1457554 RETURN_LOCAL)
path0 is assigned as a pointer to this right before it goes out of scope.
(cherry picked from commit 81328f30703bd7225e7e73aedb0994a7293ce190)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
| |
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 2c4928d37edc5e4aeec3c0b79fa3460b1ec9b60d)
|
|
|
|
|
|
|
|
|
|
| |
(GH-20888)
When a file ends with a line that contains a line continuation character
the text of the emitted SyntaxError is empty, contrary to the old
parser, where the error text contained the text of the last line.
(cherry picked from commit 113e2b0a07c72c0d5e3489076afb14f6b3ad1049)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Windows, GH-include "pyerrors.h" no longer defines "snprintf" and
"vsnprintf" macros.
PyOS_snprintf() and PyOS_vsnprintf() should be used to get portable
behavior.
Replace snprintf() calls with PyOS_snprintf() and replace vsnprintf()
calls with PyOS_vsnprintf().
(cherry picked from commit e822e37946f27c09953bb5733acf3b07c2db690f)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
| |
bpo-40910, bpo-40953: PyConfig_Clear() clears _orig_argv.
(cherry picked from commit e2d47a0568c6da9229580829917fd6aa702133b3)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
| |
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 9672912e8f90374fd31b37ca0fb7cefbc6f4c555)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
| |
(cherry picked from commit 29c117202e386bad1d66ae336e2fefa1a1809ee0)
Co-authored-by: An Long <aisk@users.noreply.github.com>
|
|
|
|
|
|
| |
importlib.resources.files (GH-20576)" (#20760)
This reverts commit 9cf1be46e3692d565461afd3afa326d124d743dd due to
https://bugs.python.org/issue40924.
|
|
|
|
|
|
|
| |
(GH-20605) (GH-20725)
(cherry picked from commit 8f023a2f664f902a3d0b7a6f64d63afc0d1c15ae)
Co-authored-by: Sandro Mani <manisandro@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Export explicitly the Py_GetArgcArgv() function to the C API and
document the function. Previously, it was exported implicitly which
no longer works since Python is built with -fvisibility=hidden.
* Add PyConfig._orig_argv member.
* Py_InitializeFromConfig() no longer calls _PyConfig_Write() twice.
* PyConfig_Read() no longer initializes Py_GetArgcArgv(): it is now
_PyConfig_Write() responsibility.
* _PyConfig_Write() result type becomes PyStatus instead of void.
* Write an unit test on Py_GetArgcArgv().
(cherry picked from commit e81f6e687d0f04a45f2389d0b43fafd6d8491624)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Provide native .files support on SourceFileLoader.
* Add native importlib.resources.files() support to zipimporter. Remove fallback support.
* make regen-all
* 📜🤖 Added by blurb_it.
* Move 'files' into the ResourceReader so it can carry the relevant module name context.
* Create 'importlib.readers' module and add FileReader to it.
* Add zip reader and rely on it for a TraversableResources object on zipimporter.
* Remove TraversableAdapter, no longer needed.
* Update blurb.
* Replace backslashes with forward slashes.
* Incorporate changes from importlib_metadata 2.0, finalizing the interface for extension via get_resource_reader.
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 843c27765652e2322011fb3e5d88f4837de38c06)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
|
|
|
|
|
| |
(cherry picked from commit 68874a8502da440a1dc4746cf73262648b870aee)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)
Add _Py_EnsureTstateNotNULL(tstate) macro: call Py_FatalError() if
tstate is NULL, the error message contains the current function name.
(cherry picked from commit 3026cad59b87751a9215111776cac8e819458fce)
* bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)
PyOS_InterruptOccurred() now fails with a fatal error if it is called
with the GIL released.
(cherry picked from commit cbe129692293251e7fbcea9ff0d822824d90c140)
|
|
|
| |
(cherry picked from commit 90d297012b3848454)
|
|
|
|
|
|
|
| |
when dict unpacking and keyword arguments are interleaved. (GH-20553) (GH-20569)
(cherry picked from commit db64f12e4deda2abbafb6d2bd5c06762fca991ff)
Co-authored-by: Mark Shannon <mark@hotpy.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-20514)
* Fix failure of _Py_dg_dtoa to remove trailing zeros
* Add regression test and news entry
* Add explanation about why it's safe to strip trailing zeros
* Make code safer, clean up comments, add change note at top of file
* Nitpick: avoid implicit int-to-float conversion in tests
(cherry picked from commit 895c9c1d438367722f74f437fda96767d770662b)
Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyType_FromSpec types (reverts GH-19414) (GH-20264)
Heap types now always visit the type in tp_traverse. See added docs for details.
This reverts commit 0169d3003be3d072751dd14a5c84748ab63a249f.
Automerge-Triggered-By: @encukou
(cherry picked from commit 1cf15af9a6f28750f37b08c028ada31d38e818dd)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
| |
(GH-20196) (GH-20464)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit c116c94)
Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit c73914a562580ae72048876cb42ed8e76e2c83f9)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
|
|
|
|
|
|
|
|
|
|
| |
This updates _PyErr_ChainStackItem() to use _PyErr_SetObject()
instead of _PyErr_ChainExceptions(). This prevents a hang in
certain circumstances because _PyErr_SetObject() performs checks
to prevent cycles in the exception context chain while
_PyErr_ChainExceptions() doesn't.
(cherry picked from commit 7c30d12bd5359b0f66c4fbc98aa055398bcc8a7e)
Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
|
|
|
|
|
|
|
| |
(GH-20228)
Remove --with-experimental-isolated-subinterpreters configure option
in Python 3.9: the experiment continues in the master branch, but
it's no longer needed in 3.9.
|
|
|
|
| |
(GH-20156)
|