| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
(cherry picked from commit de6f20a6de48d63066b2cf5b317f50629f01d74a)
Co-authored-by: Dong-hee Na <donghee.na@python.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Python is embedded (GH-21298) (#21354)
* bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21298)
* bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded.
* Add CVE number
* Updates for 3.6
|
|
|
|
|
| |
(cherry picked from commit 946b29ea0b3b386ed05e87e60b8617c9dc19cd53)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
| |
(cherry picked from commit 9a69ae8a78785105ded02b083b2e5cd2dd939307)
|
|
|
|
|
|
|
|
| |
(GH-11047) (GH-11107) (GH-11108)
(cherry picked from commit bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d)
(cherry picked from commit 3cae16d2e98ffaa89ddd311df70a857dfaff4020)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
(GH-11077) (GH-11106)
(cherry picked from commit 8905fcc85a6fc3ac394bc89b0bbf40897e9497a6)
|
|
|
|
|
|
|
|
|
|
|
|
| |
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) (GH-11026)
(cherry picked from commit 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9)
(cherry picked from commit 602d307ac5e8a2da38a193dca3bdfef5994dfe67)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
| |
(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)
|
|
|
|
|
|
| |
(GH-10749)
Fix also return type for few other functions (clear, releasebuffer).
(cherry picked from commit d4f9cf5545d6d8844e0726552ef2e366f5cc3abd)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-10720)
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)
(cherry picked from commit 6f5fa1b4be735159e964906ab608dc467476e47c)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-10621)
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)
(cherry picked from commit 6eff6b8eecd7a8eccad16419269fa18ec820922e)
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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)
Contributed by Gregory P. Smith [Google LLC]
Also includes a whitespace fix from make patchcheck to _posixsubprocess.c - unrelated to the main change that makes the CI happy so I'm just doing it now rather than creating a separate PR.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-10422)
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/7db3c488335168993689ddae5914a28e16188447#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)
|
|
|
|
|
|
|
|
|
|
|
| |
lines. (GH-10284) (GH-10335)
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)
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
| |
On macOS, fix reading from and writing into a file with a size larger than 2 GiB.
(cherry picked from commit 74a8b6ea7e0a8508b13a1c75ec9b91febd8b5557)
|
|
|
|
|
| |
(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>
|
|
|
|
|
|
|
|
|
| |
Fix the following warning:
Python/pystrtod.c: In function 'format_float_short':
Python/pystrtod.c:1007:13: warning: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
strncpy(p, "ERR", 3);
(cherry picked from commit 9fb84157595a385f15799e5d0729c1e1b0ba9d38)
|
|
|
|
|
|
|
|
|
|
|
| |
The recursive frame pruning code always undercounted the number of elided frames
by one. That is, in the "[Previous line repeated N more times]" message, N would
always be one too few. Near the recursive pruning cutoff, one frame could be
silently dropped. That situation is demonstrated in the OP of the bug report.
The fix is to start the identical frame counter at 1.
(cherry picked from commit d545869d084e70d4838310e79b52a25a72a1ca56)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
|
|
| |
On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also forces
the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if
the LC_CTYPE locale is "C".
|
|
|
|
|
| |
(cherry picked from commit a2eefa67542c25617a58c03a27c17fd48e2a0856)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
|
|
|
| |
builtin_sum_impl() (GH-8872)
Reported by Svace static analyzer.
(cherry picked from commit 2b824b2538c4a5f9f520c5de8a1eae5a0c181a94)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
|
|
|
| |
(GH-8852)
Reported by Svace static analyzer.
(cherry picked from commit 28853a249b1d0c890b7e9ca345290bb8c1756446)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
|
|
| |
(GH-8262) (GH-8424)
(cherry picked from commit aba24ff3601ddc86b85e01880a8be596fb799287)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
Cherrypick tests from 16dfca4d829e45f36e71bf43f83226659ce49315
While the regression is not in 3.6, it's worth to backport test cases
to 3.6 branch too.
|
|
|
|
|
| |
(cherry picked from commit 993030aac576710a46b3dd0b4864f819d4a94145)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 504373c59b48f1ea12132d515459022730db6047)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
BEFORE_ASYNC_WITH. (GH-8159) (GH-8198)
This will prevent emitting a resource warning when the execution was
interrupted by Ctrl-C between calling open() and entering a 'with' block
in "with open()".
(cherry picked from commit 3f4d90d4d72921f16babd3f52d7df804916af224)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
| |
(GH-7918) (GH-8069)
PyErr_Print() will not return when the exception is a SystemExit, so
decref the __main__ module object in that case.
(cherry picked from commit d8cba5d16f1333fd625726fc72e66afbd45b8d00)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
| |
Directly executed pyc files were being kept open longer than necessary.
(cherry picked from commit ea737751b10fff752aafed0231e8a02b82ba365d)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit a8eb58546b37a7cd5f332f019bb07388f5212c2d)
Co-authored-by: A. Jesse Jiryu Davis <jesse@emptysquare.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-5337) (#6536)
When an unawaited coroutine is collected very late in shutdown --
like, during the final GC at the end of PyImport_Cleanup -- then it
was triggering an interpreter abort, because we'd try to look up the
"warnings" module and not only was it missing (we were prepared for
that), but the entire module system was missing (which we were not
prepared for).
I've tried to fix this at the source, by making the utility function
get_warnings_attr robust against this in general. Note that it already
has the convention that it can return NULL without setting an error,
which is how it signals that the attribute it was asked to fetch is
missing, and that all callers already check for NULL returns.
There's a similar check for being late in shutdown at the top of
warn_explicit, which might be unnecessary after this fix, but I'm not
sure so I'm going to leave it..
(cherry picked from commit dba976b8a28d6e5daa66ef31a6a7c694a9193f6a)
Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
|
|
|
|
|
|
|
| |
(GH-7269)
(cherry picked from commit a5c42284e69fb309bdd17ee8c1c120d1be383012)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
The hash implementation casts the input pointer to uint64_t* and directly reads
from this, which may cause unaligned accesses. Use memcpy() instead so this code
will not crash with SIGBUS on sparc.
https://bugs.gentoo.org/show_bug.cgi?id=636400
(cherry picked from commit 1e2ec8a996daec65d8d5a3d43b66a9909c6d0653)
Co-authored-by: Rolf Eike Beer <eike@sf-mail.de>
|
|
|
|
|
|
| |
(GH-6604)
(cherry picked from commit e9d9494d6b2a5e0c2d48d22c7f0d5e95504b4f7e)
|
|
|
|
|
| |
(cherry picked from commit 3a9ccee0e5dbf7d67f5ab79f6095755969db117c)
Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 0c1c4563a65ac451021d927058e4f25013934eb2)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
|
|
|
|
|
| |
when __aenter__() or __aexit__() return non-awaitable object.
(cherry picked from commit a68f2f0578bbf812fa2264d0e0bb388340d6e230)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
(GH-6321)
(cherry picked from commit a95d98607efe0c43475b354543e49bf8e240bc6f)
|
|
|
|
|
|
| |
(GH-6154). (GH-6199)
(cherry picked from commit b9744e924ca07ba7db977e5958b91cd8db565632)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fstat may block for long time if the file descriptor is on a
non-responsive NFS server, hanging all threads. Most fstat() calls are
handled by _Py_fstat(), releasing the GIL internally, but but
_Py_fstat_noraise() does not release the GIL, and most calls release the
GIL explicitly around it.
This patch fixes last 2 calls to _Py_fstat_no_raise(), avoiding hangs
when calling:
- mmap.mmap()
- os.urandom()
- random.seed()
(cherry picked from commit 4484f9dca9149da135bbae035f10a50d20d1cbbb)
Co-authored-by: Nir Soffer <nirsof@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-6060)
and remove redundant code.
(cherry picked from commit 67ee07795bcd84b679c000780212d4d81a1490a3)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 9e94c0d3c78d1bc582c865240ed9353fe9689b2a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(#5504)" (#5911)
This reverts commit a71397fb6603d0fe673acd7765c74699cd28fe7b.
|
|
|
|
|
|
|
| |
This function expects the destination buffer size to be given
in wide characters, not bytes.
(cherry picked from commit b3b4a9d3001f1fc7df8efcccdce081de54fa5eab)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|