| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
(GH-14605)
https://bugs.python.org/issue37500
|
|
|
|
| |
Store (GH-14450)
|
|
|
|
|
|
|
|
|
| |
(GH-14141)
On Windows, os.dup() no longer creates an inheritable fd when handling a
character file.
(cherry picked from commit 28fca0c422b425a6be43be31add0a5328c16b0b8)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
| |
(GH-14111)
(cherry picked from commit 7a68f8c28bb78d957555a5001dac4df6345434a0)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-14071) (GH-14073)
Fix a regression introduced by af8646c8054d0f4180a2013383039b6a472f9698 that was causing code of the form:
if True and False:
do_something()
to be optimized incorrectly, eliminating the block..
(cherry picked from commit 05f831865545b08c9a21cfb7773af58b76ec64cb)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyErr_WriteUnraisable() now displays the exception even if displaying
the traceback failed. Moreover, hold a strong reference to sys.stderr
while using it.
Document that an exception must be set when calling
PyErr_WriteUnraisable(), but don't add an assertion to check it at
runtime.
Cleanup: use longer names for variables and create
write_unraisable_exc_file() subfunction.
|
|
|
|
|
|
|
|
|
|
| |
(GH-13332)
Move the check for dead conditionals (if 0) to the peephole optimizer
and make sure that the code block is still compiled to report any
existing syntax errors within.
(cherry picked from commit af8646c8054d0f4180a2013383039b6a472f9698)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 29500737d45cbca9604d9ce845fb2acc3f531401)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
`PyInterpreterState_New()` (GH-8767) (GH-13237)
* A pointer in `PyInterpreterState_New()` could have been `NULL` when being dereferenced.
* Memory was leaked in `PyInterpreterState_New()` when taking some error-handling code path.
(cherry picked from commit 95d630e)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)
Change PyDTrace_GC_DONE() argument type from int to Py_ssize_t.
(cherry picked from commit edad38e3e05586ba58291f47756eb3fb808f5577)
* bpo-30465: Fix C downcast warning on Windows in ast.c (#6593)
ast.c: fstring_fix_node_location() downcasts a pointer difference to
a C int. Replace int with Py_ssize_t to fix the compiler warning.
(cherry picked from commit fb7e7992beec7f76cc2db77ab6ce1e86446bfccf)
* bpo-9566: Fix compiler warnings in peephole.c (GH-10652)
(cherry picked from commit 028f0ef4f3111d2b3fc5b971642e337ba7990873)
* bpo-27645, sqlite: Fix integer overflow on sleep (#6594)
Use the _PyTime_t type and round away from zero (ROUND_UP,
_PyTime_ROUND_TIMEOUT) the sleep duration, when converting a Python
object to seconds and then to milliseconds. Raise an OverflowError in
case of overflow.
Previously the (int)double conversion rounded towards zero
(ROUND_DOWN).
(cherry picked from commit ca405017d5e776a2e3d9291236e62d2e09489dd2)
|
|
|
|
|
|
|
|
|
|
| |
Fix Python Initialization code on FreeBSD to detect properly when
stdin file descriptor (fd 0) is invalid.
On FreeBSD, fstat() must be used to check if stdin (fd 0) is valid.
dup(0) doesn't fail if stdin is invalid in some cases.
(cherry picked from commit 3092d6b2630e4d2bd200fbc3231c27a7cba4d6b2)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
| |
|
|
|
|
|
|
|
| |
(GH-10625) (GH-12496)
compiler_call() needs to check if an error occurred during the
maybe_optimize_method_call() call.
(cherry picked from commit 97f5de01adf993aee17dcd26e22ae421d013f372)
|
|
|
|
| |
At Python initialization, the current directory is no longer
prepended to sys.path if it has been removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix an unlikely memory leak on conversion from string to float in the
function _Py_dg_strtod() used by float(str), complex(str),
pickle.load(), marshal.load(), etc.
Fix an unlikely memory leak in _Py_dg_strtod() on "undfl:" label:
rewrite memory management in this function to always release all
memory before exiting the function. Initialize variables to NULL, and
set them to NULL after calling Bfree() at the "cont:" label.
Note: Bfree(NULL) is well defined: it does nothing.
(cherry picked from commit 9776b0636ae39668d3ce1c006d4be01dad01bf9f)
|
|
|
|
|
|
|
| |
(GH-12322)
(cherry picked from commit d53fe5f407ff4b529628b01a1bcbf21a6aad5c3a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
Use correct interpretation of return value from APIs.
(cherry picked from commit 05e922136a3286893bd489a8f2ecfa0dba4da368)
Co-authored-by: native-api <ivan_pozdeev@mail.ru>
|
|
|
|
|
|
|
|
| |
Handle the case of an empty module name in PYTHONBREAKPOINT.
Fixes a regression introduced in bpo-34756.
(cherry picked from commit 3607ef43c4a1a24d44f39ff54a77fc0af5bfa09a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
sys.breakpointhook(). (GH-9457)
(cherry picked from commit 6fe9c446f8302553952f63fc6d96be4dfa48ceba)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
_PyImport_FindExtensionObjectEx(). (GH-11128)
(cherry picked from commit 89c4f90df97f6039325e354167e8f507bf199fd9)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
| |
(cherry picked from commit 9a69ae8a78785105ded02b083b2e5cd2dd939307)
|
|
|
|
|
|
|
|
|
|
| |
Python source code uses on several places ifdef sun or defined(sun) without the underscores, which is not standard compliant and shouldn't be used.
Defines should check for __sun instead. Reference: http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_systemGH-Solaris
https://bugs.python.org/issue35550
(cherry picked from commit 6f9bc72c79c3262e5d0f2c0e96b016477399cfb1)
Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
|
|
|
|
|
| |
(GH-11047) (GH-11107)
(cherry picked from commit bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d)
|
|
|
|
|
|
|
|
| |
* bpo-35454: Fix miscellaneous minor issues in error handling.
* Fix a null pointer dereference.
(cherry picked from commit 8905fcc85a6fc3ac394bc89b0bbf40897e9497a6)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit dffccc6b594951fc798973e521da205785823f0f)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
(GH-11063)
(cherry picked from commit 72ff7b4c000f7b8199231a0eb1ca4b119fab40a5)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In _localemodule.c and selectmodule.c, remove dead code that would
cause double decrefs if run.
In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases
where a new list is populated and there is no possibility of an error.
In addition, check if the list changed size in the loop in array_array_fromlist().
(cherry picked from commit 99d56b53560b3867844472ae381fb3f858760621)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
| |
(GH-11015) (GH-11020)
(cherry picked from commit 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9)
|
|
|
|
|
|
|
| |
(GH-10914)
(cherry picked from commit 2a893430c9c8378cbdfac95895a64fa07aaff9ed)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Fix an undefined behaviour in the pthread implementation of
PyThread_start_new_thread(): add a function wrapper to always return
NULL.
Add pythread_callback struct and pythread_wrapper() to thread_pthread.h.
(cherry picked from commit 9eea6eaf23067880f4af3a130e3f67c9812e2f30)
Co-authored-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
|
|
|
|
|
|
| |
Fix also return type for few other functions (clear, releasebuffer).
(cherry picked from commit d4f9cf5545d6d8844e0726552ef2e366f5cc3abd)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Fix str.format(), float.__format__() and complex.__format__() methods
for non-ASCII decimal point when using the "n" formatter.
Rewrite _PyUnicode_InsertThousandsGrouping(): it now requires
a _PyUnicodeWriter object for the buffer and a Python str object
for digits.
(cherry picked from commit 59423e3ddd736387cef8f7632c71954c1859bed0)
|
|
|
|
|
|
|
|
|
|
| |
bpo-34523, bpo-35290: C locale coercion now resets the Python
internal "force ASCII" mode. This change fix the filesystem encoding
on FreeBSD CURRENT, which has a new "C.UTF-8" locale, when
the UTF-8 mode is disabled.
Add _Py_ResetForceASCII(): _Py_SetLocaleFromEnv() now calls it.
(cherry picked from commit 353933e712b6c7f7ba9a9a50bd5bd472db7c35d0)
|
|
|
|
|
| |
(GH-10660)
This reverts commit d2be9a5c13221fb84c2221bbfd93efac6111e697.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
locale.localeconv() now sets temporarily the LC_CTYPE locale to the
LC_MONETARY locale if the two locales are different and monetary
strings are non-ASCII. This temporary change affects other threads.
Changes:
* locale.localeconv() can now set LC_CTYPE to LC_MONETARY to decode
monetary fields.
* Add LocaleInfo.grouping_buffer: copy localeconv() grouping string
since it can be replaced anytime if a different thread calls
localeconv().
(cherry picked from commit 02e6bf7f2025cddcbde6432f6b6396198ab313f4)
|
|
|
|
| |
sys.executable (GH-9861)
|
|
|
|
|
|
|
| |
This missed PyErr_NoMemory() could cause a SystemError when calling
_symtable.symtable().
(cherry picked from commit ad65f15581173542f1d2a9968a63bee272510ce3)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* The _PySys_EndInit() function now copies the
config->module_search_path list, so config is longer modified when
sys.path is updated.
* config->warnoptions list and config->xoptions dict are also copied
* test_embed: InitConfigTests now also tests
main_config['module_search_path']
* Fix _Py_InitializeMainInterpreter(): don't use config->warnoptions
but sys.warnoptions to decide if the warnings module should
be imported at startup.
(cherry picked from commit 37cd982df02795905886ab36a2378ed557cb6f60)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
|
|
|
| |
Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER.
Project based C Preprocessor namespacing at its finest. :P
(cherry picked from commit 3015fb8ce4d25603434b9b44bb7effb98a481532)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds configure flags for msan and ubsan builds to make it easier to enable.
These also encode the detail that address sanitizer and memory sanitizer
should disable pymalloc.
Define MEMORY_SANITIZER when appropriate at build time and adds workarounds
to existing code to mark things as initialized where the sanitizer is otherwise unable to
determine that. This lets our build succeed under the memory sanitizer. not all tests
pass without sanitizer failures yet but we're in pretty good shape after this.
(cherry picked from commit 1584a0081500d35dc93ff88e5836df35faf3e3e2)
Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google LLC]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return.
Do a bounds check within find_op so it can return before going past the end as a safety measure.
https://github.com/python/cpython/commit/7db3c488335168993689ddae5914a28e16188447GH-diff-a33329ae6ae0bb295d742f0caf93c137
introduced this off by one error while fixing another one nearby.
This bug was shipped in all Python 3.6 and 3.7 releases.
The included unittest won't fail unless you do a clang msan build.
(cherry picked from commit 49fa4a9f1ef387e16596f271414c855339eadf09)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-10284)
Two kind of mistakes:
1. Missed space. After concatenating there is no space between words.
2. Missed comma. Causes unintentional concatenating in a list of strings.
(cherry picked from commit 34fd4c20198dea6ab2fe8dc6d32d744d9bde868d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
| |
Don't call _Py_FatalError_PrintExc() nor flush_std_files() if the
current thread doesn't hold the GIL, or if the current thread
has no Python state thread.
(cherry picked from commit 3a228ab17c2a9cffd1a2f15f30d6209768de20a6)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
| |
Compilation fails on macOS because _Py_GetForceASCII() wasn't define:
always implement implement (default implementation: just return 0).
|
|
|
|
|
| |
* Add _Py_GetForceASCII(): check if Python forces the usage of ASCII
in Py_DecodeLocale() and Py_EncodeLocale().
* initfsencoding() now uses ASCII if _Py_GetForceASCII() is true.
|
|
|
|
|
|
| |
On macOS, fix reading from and writing into a file with a size larger than 2 GiB.
(cherry picked from commit 74a8b6ea7e0a8508b13a1c75ec9b91febd8b5557)
Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
|
|
|
|
|
| |
(cherry picked from commit 53ebf4b0709f431b7262aa5daccef7eafde7383e)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit fc439d20de32b0ebccca79a96e31f83b85ec4eaf)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
| |
type specifier. (GH-9666)
(cherry picked from commit cbda8fc5d76b10bcbb92d927537576c229143836)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Compiling a string annotation containing a lambda with keyword-only
argument without default value caused a crash.
* Remove the final "*" (it is incorrect syntax) in the representation of
lambda without *args and keyword-only arguments when compile from AST.
* Improve the representation of lambda without arguments.
(cherry picked from commit 2a2940e5c3e6d92f4fac5e9d361a1e224bb2f12e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|