| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Automerge-Triggered-By: GH:benjaminp
(cherry picked from commit ba00f0d93a4aea85ae8089f139856a7c450584d7)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
| |
|
|
|
|
|
| |
sys.stderr (GH-25075). (GH-25085)
(cherry picked from commit 09b90a037d18f5d4acdf1b14082e57bda78e85d3)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit de6f20a6de48d63066b2cf5b317f50629f01d74a)
Co-authored-by: Dong-hee Na <donghee.na@python.org>
|
| |
|
|
|
|
|
| |
Python is embedded (GH-21297) (#21298)
* bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded.
* Add CVE number
|
| |
|
|
|
|
| |
Save the live exception during the course of remove_module().
(cherry picked from commit 94a64e9cd411a87514b68082c1c437eb3b49dfb9)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
| |
ast_unparse.c (GH-20156). (GH-20192)
(cherry picked from commit 2135e10dc717c00d10d899d232bebfc59bb25032)
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
|
| |
|
| |
Co-authored-by: Minmin Gong <gongminmin@msn.com>
|
| |
|
|
|
|
|
| |
(GH-20137)
(cherry picked from commit f660567937277cc3a2cd53af77bbb18e905427e8)
Co-authored-by: Minmin Gong <gongminmin@msn.com>
|
| |
|
|
|
|
|
|
|
|
| |
(GH-19935)
Use importlib instead of imp.
Automerge-Triggered-By: @brettcannon.
(cherry picked from commit f40bd46)
Co-authored-by: Robert Rouhani robert.rouhani@gmail.com
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-19136) (GH-19137)
PyThreadState.frame is a borrowed reference, not a strong reference:
PyThreadState_Clear() must not call Py_CLEAR(tstate->frame).
Remove test_threading.test_warnings_at_exit(): we cannot warranty
that the Python thread state of daemon threads is cleared in a
reliable way during Python shutdown.
(cherry picked from commit 5804f878e779712e803be927ca8a6df389d82cdf)
(cherry picked from commit e97c8b0688bc62959ced477d842fcd37992ef649)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-18959)
The 32-bit (49-day) TickCount relied on in EnterNonRecursiveMutex can overflow
in the gap between the 'target' time and the 'now' time WaitForSingleObjectEx
returns, causing the loop to think it needs to wait another 49 days. This is
most likely to happen when the machine is hibernated during
WaitForSingleObjectEx.
This makes acquiring a lock/event/etc from the _thread or threading module
appear to never timeout.
Replace with GetTickCount64 - this is OK now Python no longer supports XP which
lacks it, and is in use for time.monotonic().
Co-authored-by: And Clover <and.clover@bromium.com>
(cherry picked from commit 64838ce)
Co-authored-by: bobince <and+github@doxdesk.com>
|
| |
|
|
|
| |
(cherry picked from commit 185903de12de8837bf0dc0008a16e5e56c66a019)
Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
|
| |
|
|
| |
(cherry picked from commit 2d2f85517f8216146a2f888d1ad4d765b3be2339)
|
| |
|
|
|
| |
- Threads created by PyGILState_Ensure() could have a duplicate tstate->id.
(cherry picked from commit b3b9ade4a3d3fe00d933bcd8fc5c5c755d1024f9)
|
| |
|
|
|
| |
(cherry picked from commit 2d2f85517f8216146a2f888d1ad4d765b3be2339)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 946b29ea0b3b386ed05e87e60b8617c9dc19cd53)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
| |
|
|
|
|
|
| |
(GH-17596) (GH-17601)
(cherry picked from commit 5936a4ce914d42af97b9238e5090dedc8d5b0bd2)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
for if_stmt (GH-17582) (#17584)
When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node.
https://bugs.python.org/issue39031
Automerge-Triggered-By: @pablogsal.
(cherry picked from commit 025a602af7ee284d8db6955c26016f3f27d35536)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None.
https://bugs.python.org/issue38979
Automerge-Triggered-By: @asvetlov
(cherry picked from commit 28c91631c24e53713ad0e8a2bbae716373f5e53d)
Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 33b671e72450bf4b5a946ce0dde6b7fe21150108)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
| |
|
|
|
|
| |
decorators. (GH-16861). (GH-16930)
(cherry picked from commit 26ae9f6d3d755734c9f371b9356325afe5764813)
|
| |
|
|
|
|
| |
numbers's -> number's
(cherry picked from commit 7320ec05f72fc27b25789fe76f8297644e7e7e0a)
Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
|
| | |
|
| |
|
|
|
| |
(cherry picked from commit 5bc6a7c06eda20ba131ecba6752be0506d310181)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 2798b60c55619d8981288b69c20ba4a09efc7b0b)
Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit a8e0d3141e271b3c0fbb7399a911f0c3aa567e30)
Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit a05fcd3c7adf6e3a0944da8cf80a3346882e9b3b)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 01171ebd966b0cd6352057799ad876dd1e07942e)
Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 5dfbb4d50333e7a91fc0cd8c03a2f2f2cf56dbd9)
Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
|
| |
|
|
| |
(GH-15962)
|
| |
|
|
|
|
|
|
| |
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.
(cherry picked from commit 39de95b746c990e6a2fe9af5fad01747f58b2e5f)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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..
(cherry picked from commit 92420b3e679959a7d0ce875875601a4cee45231e)
Co-authored-by: Ben Lewis <benjimin@users.noreply.github.com>
(cherry picked from commit 0a6693a469cfb1dd5c8048d8cb4231a7b5883251)
Co-authored-by: Brett Cannon <54418+brettcannon@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 5be666010e4df65dc4d831435cc92340ea369f94)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit af2f5b1723b95e45e1f15b5bd52102b7de560f7c)
Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
|
| |
|
|
|
| |
(GH-14605)
https://bugs.python.org/issue37500
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix sys.excepthook() and PyErr_Display() if a filename is a bytes
string. For example, for a SyntaxError exception where the filename
attribute is a bytes string.
Cleanup also test_sys:
* Sort imports.
* Rename numruns global var to INTERN_NUMRUNS.
* Add DisplayHookTest and ExceptHookTest test case classes.
* Don't save/restore sys.stdout and sys.displayhook using
setUp()/tearDown(): do it in each test method.
* Test error case (call hook with no argument) after the success case.
(cherry picked from commit f9b7457bd7f438263e0d2dd1f70589ad56a2585e)
|
| |
|
|
| |
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)
|