| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
| |
(cherry picked from commit f60bf0e168255b7675a4c049250ba6b202f8e647)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
(GH-8159)
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>
|
| |
|
|
|
| |
(cherry picked from commit d8c3e820b4fcdc45b80ba47f615c95e99e2e931b)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
(GH-7918) (GH-8070)
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>
|
| |
|
|
|
| |
(cherry picked from commit 41cb0baea96a80360971908a0bd79d9d40dd5e44)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
| |
|
|
|
|
| |
Directly executed pyc files were being kept open longer than necessary.
(cherry picked from commit ea737751b10fff752aafed0231e8a02b82ba365d)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
| |
Calling Py_Initialize() twice does nothing, instead of failing with a
fatal error: restore the Python 3.6 behaviour.
(cherry picked from commit 209abf746985526bce255e2fba97d3246924885d)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
| |
|
|
|
| |
(cherry picked from commit 378c53cc3187dba57c7560ccc2557f516c8a7bc8)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
| |
|
|
|
| |
(cherry picked from commit 2a4a62ba4ae770bbc7b7fdec0760031c83fe1f7b)
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
|
| |
|
|
|
| |
(cherry picked from commit a8eb58546b37a7cd5f332f019bb07388f5212c2d)
Co-authored-by: A. Jesse Jiryu Davis <jesse@emptysquare.net>
|
| |
|
|
|
| |
(cherry picked from commit a5c42284e69fb309bdd17ee8c1c120d1be383012)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
| |
Remove the docstring attribute of AST types and restore docstring
expression as a first stmt in their body.
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
bpo-25612, bpo-33612: Remove an assertion from PyThreadState_Clear()
which failed at Python shutdown or on fork if a thread was running a
generator.
(cherry picked from commit b6dccf54fd3bac9c87348d96f9d6b571608c15bc)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
| |
|
|
|
|
|
| |
(GH-6774). (GH-6927)
(cherry picked from commit 64fddc423fcbe90b8088446c63385ec0aaf3077c)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
| |
Don't crash on warnings.warn_explicit() if module_globals is not a dict.
(cherry picked from commit b056562860c227bad2e0ba7cd3130e115c007768)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
| |
|
| |
Remove the interpreters testing helper (and xid registry).
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
functions (GH-6616). (GH-6619)
|
| |
|
|
|
| |
(cherry picked from commit e9d9494d6b2a5e0c2d48d22c7f0d5e95504b4f7e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(GH-6273)
External importers were being added in both phases of the import
system initialisation.
They're only supposed to be added in the second phase, after the
import machinery has been appropriately configured.
(cherry picked from commit 0977091dca59709864b14cfc129388f1f0de7bf7)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 61f82e0e337f971da57f8f513abfe693edf95aa5)
Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
|
| |
|
|
|
|
| |
invalidating caches (GH-6402) (GH-6403)
An entry of None in sys.path_importer_cache represents a negative/missing finder for a path, so clearing it out makes sense.
(cherry picked from commit 9e2be60634914f23db2ae5624e4acc9335bf5fea)
|
| |
|
|
|
| |
(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>
|
| |
|
|
|
| |
(cherry picked from commit aa8e51f5ebb2a71c76059f050de01fc3c985376a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Historically, -m added the empty string as sys.path
zero, meaning it resolved imports against the current
working directory, the same way -c and the interactive
prompt do.
This changes the sys.path initialisation to add the
*starting* working directory as sys.path[0] instead,
such that changes to the working directory while the
program is running will have no effect on imports
when using the -m switch.
(cherry picked from commit d5d9e02dd3c6df06a8dd9ce75ee9b52976420a8b)
|
| |
|
|
|
|
|
|
|
|
|
| |
- new test case for pre-initialization of sys.warnoptions and sys._xoptions
- restored ability to call these APIs prior to Py_Initialize
- updated the docs for the affected APIs to make it clear they can be
called before Py_Initialize
- also enhanced the existing embedding test cases
to check for expected settings in the sys module
(cherry picked from commit bc77eff8b96be4f035e665ab35c1d06e22f46491)
Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit a95d98607efe0c43475b354543e49bf8e240bc6f)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
When comprehensions switched to using a nested scope, the old
code for generating a temporary name to hold the accumulation
target became redundant, but was never actually removed.
Patch by Nitish Chandra.
(cherry picked from commit 3a087beddd9f0955eb9080a6fd1499ff89ca74bf)
Co-authored-by: Nitish Chandra <nitishchandrachinta@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 3c7ac7ea2098c672e50402d1d1b5ee9f14586437)
Co-authored-by: Xiang Zhang <angwerzx@126.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Fix a crash on fork when using a custom memory allocator (ex: using
PYTHONMALLOC env var).
_PyGILState_Reinit() and _PyInterpreterState_Enable() now use the
default RAW memory allocator to allocate a new interpreters mutex on
fork.
(cherry picked from commit 5d92647102fac9e116b98ab8bbc632eeed501c34)
Co-authored-by: Victor Stinner <victor.stinner@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 4af8fd561433826ac897c55e41a087a5c5dbacf3)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
| |
The CPython runtime assumes that there is a one-to-one relationship (for a given interpreter) between PyThreadState and OS threads. Sending and receiving on a channel in the same interpreter was causing crashes because of this (specifically due to a check in PyThreadState_Swap()). The solution is to not switch threads if the interpreter is the same.
(cherry picked from commit f53d9f2778a87bdd48eb9030f782a4ebf9e7622f)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
(gh-5710)
(cherry picked from commit 4c6955e2b0ccf88c705f8d1fac685a8e65f9699e)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit bfe4fd5f2e96e72eecb5b8a0c7df0ac1689f3b7e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(GH-5562)
Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process. This bug appears to have been introduced in 3.4 with the inheritable file descriptors support.
This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions). `ioctl` is not a POSIX async-signal-safe approved function.
ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
(cherry picked from commit c1e46e94de38a92f98736af9a42d89c3975a9919)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|
| |
|
|
|
|
| |
Fix typos found by codespell in docs, docstrings, and comments.
(cherry picked from commit c3d9508ff22ece9a96892b628dd5813e2fb0cd80)
Co-authored-by: Leo Arias <leo.arias@canonical.com>
|
| |
|
|
|
| |
(cherry picked from commit 4e9da0d163731caa79811c723c703ee416c31826)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
* Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages.
* Make sure ``__spec__.origin` matches ``__file__`` for namespace packages.
https://bugs.python.org/issue32303
https://bugs.python.org/issue32305
(cherry picked from commit bbbcf8693b876daae4469765aa62f8924f39a7d2)
Co-authored-by: Barry Warsaw <barry@python.org>
|
| |
|
|
|
|
|
|
| |
Clarify that the level argument is used to determine whether to
perform absolute or relative imports: 0 is absolute, while a positive number
is the number of parent directories to search relative to the current module.
(cherry picked from commit 461d225b195eec5269f317323b41115516144c41)
Co-authored-by: oldk <oldk1331@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 55e0839f2672e029c2b96514028c77c31ffbe41f)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
| |
|
|
|
| |
(cherry picked from commit 01a0cb891694cf73b86f799c48d8c78de1b8f74c)
Co-authored-by: Dmitry Alimov <dvalimov@gmail.com>
|
| |
|
|
|
|
| |
* bpo-32711: Fix warnings for Python/ast_unparse.c
(cherry picked from commit 83ab995871ffd504ac229bdbf5b9e9ffc1032815)
Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
|
| |
|
|
|
| |
(gh-1748)
The module is primarily intended for internal use in the test suite. Building the module under Windows will come in a follow-up PR.
|
| | |
|