summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
...
* [3.8] bpo-39562: Prevent collision of future and compiler flags (GH-19230) ↵Pablo Galindo2020-05-011-1/+1
| | | | | | | | | | | (GH-19835) The constant values of future flags in the __future__ module is updated in order to prevent collision with compiler flags. Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing with CO_FUTURE_DIVISION.. (cherry picked from commit 4454057269b995341b04d13f0bf97f96080f27d0) Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
* bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691) (GH-19698)Victor Stinner2020-04-241-1/+1
| | | | | | | | If _PyCode_InitOpcache() fails in _PyEval_EvalFrameDefault(), use "goto exit_eval_frame;" rather than "return NULL;" to exit the function in a consistent state. For example, tstate->frame is now reset properly. (cherry picked from commit 25104949a5a60ff86c10691e184ce2ecb500159b)
* [3.8] closes bpo-40184: Only define pysiphash if the hash algorithm is ↵Benjamin Peterson2020-04-041-7/+7
| | | | | | | SIPHASH24. (GH-19373) (cherry picked from commit 1b21573) Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
* Document most common signals (GH-19245) (GH-19257)Victor Stinner2020-03-311-1/+1
| | | | | | Document individual signals (only the most common signals): description, default action, availability. (cherry picked from commit 400e1dbcad93061f1f7ab4735202daaa5e731507)
* bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120) (GH-19136)Victor Stinner2020-03-241-2/+10
| | | | | | | | | | 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)
* bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch ↵Miss Islington (bot)2020-03-221-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-9516) (GH-19110) * bpo-22490: Remove "__PYVENV_LAUNCHER__" from the shell environment on macOS This changeset removes the environment varialbe "__PYVENV_LAUNCHER__" during interpreter launch as it is only needed to communicate between the stub executable in framework installs and the actual interpreter. Leaving the environment variable present may lead to misbehaviour when launching other scripts. * Actually commit the changes for issue 22490... * Correct typo Co-Authored-By: Nicola Soranzo <nicola.soranzo@gmail.com> * Run make patchcheck Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com> (cherry picked from commit 044cf94f610e831464a69a8e713dad89878824ce) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com> Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
* bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL ↵Miss Islington (bot)2020-03-191-2/+5
| | | | | | | | (GH-18968) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> (cherry picked from commit 9052f7a41b90f2d34011c8da68f9a4facebc8a97) Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
* bpo-35370: PyEval_SetTrace() logs unraisable error (GH-18977) (GH-19029)Victor Stinner2020-03-161-0/+2
| | | | | | If PySys_Audit() fails in PyEval_SetProfile() or PyEval_SetTrace(), log the error as an unraisable exception. (cherry picked from commit f6a58507820c67e8d0fb07875cd1b1d9f5e510a8)
* bpo-39965: Correctly raise SyntaxError if await is used outside async ↵Miss Islington (bot)2020-03-151-4/+8
| | | | | | | functions when PyCF_ALLOW_TOP_LEVEL_AWAIT is set (GH-19010) (cherry picked from commit 90235810ec28ca954bbf4b61a5ae5df7a00db409) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-39847: EnterNonRecursiveMutex() uses GetTickCount64() (GH-18780)Miss Islington (bot)2020-03-111-3/+3
| | | | | | | | | | | | | | | | | | 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 64838ce7172c7a92183b39b22504b433a33a884d) Co-authored-by: bobince <and+github@doxdesk.com>
* bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)Miss Islington (bot)2020-03-111-0/+1
| | | | | (cherry picked from commit 185903de12de8837bf0dc0008a16e5e56c66a019) Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
* bpo-39831: Remove outdated comment. (GH-18764)Miss Islington (bot)2020-03-031-3/+1
| | | | | (cherry picked from commit ae75a294352e9b9487f5dc8e88f068e7e6974dc2) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-39776: Lock ++interp->tstate_next_unique_id. (GH-18746) (#18746) (#18752)Stefan Krah2020-03-031-2/+1
| | | | | - Threads created by PyGILState_Ensure() could have a duplicate tstate->id. (cherry picked from commit b3b9ade4a3d3fe00d933bcd8fc5c5c755d1024f9)
* [3.8] bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750) (GH-18761)Pablo Galindo2020-03-031-2/+3
| | | | | (cherry picked from commit 2d2f855) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-38410: Properly handle PySys_Audit() failures (GH-18658)Serhiy Storchaka2020-03-022-32/+55
| | | | | | | _PyEval_SetAsyncGenFinalizer() and _PyEval_SetAsyncGenFirstiter() didn't include proper error handling for their PySys_Audit() calls. Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.8] bpo-38913: Fix segfault in Py_BuildValue("(sGH-O)", ...) if entered ↵Serhiy Storchaka2020-03-021-3/+3
| | | | | | with exception raised. (GH-18656). (GH-18732) (cherry picked from commit 28d0bcac8b7e6dbd28311f1283dabb6a4d649fcb)
* [3.8] bpo-39427: Document -X opt options in the CLI --help and the man page ↵Pablo Galindo2020-02-231-1/+32
| | | | | | | | | | (GH-18131) (GH-18133) https://bugs.python.org/issue39427 Automerge-Triggered-By: @pablogsal (cherry picked from commit 41f0ef6abbd304409c55612a08788cdd59fbc8a3) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.8] closes bpo-39630: Update pointers to string literals to be const char ↵Benjamin Peterson2020-02-142-2/+2
| | | | | | | | *. (GH-18511) (cherry picked from commit 7386a70746cf9aaf2d95db75d9201fb124f085df) Co-authored-by: Andy Lester <andy@petdance.com>
* bpo-39474: Fix AST pos for expressions like (a)(b), (a)[b] and (a).b. (GH-18477)Miss Islington (bot)2020-02-121-18/+18
| | | | | (cherry picked from commit 6e619c48b8e804ece9521453fc8da0640a04d5b1) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* closes bpo-39605: Fix some casts to not cast away const. (GH-18453)Miss Islington (bot)2020-02-122-2/+2
| | | | | | | | | | | | | | | | | | gcc -Wcast-qual turns up a number of instances of casting away constness of pointers. Some of these can be safely modified, by either: Adding the const to the type cast, as in: - return _PyUnicode_FromUCS1((unsigned char*)s, size); + return _PyUnicode_FromUCS1((const unsigned char*)s, size); or, Removing the cast entirely, because it's not necessary (but probably was at one time), as in: - PyDTrace_FUNCTION_ENTRY((char *)filename, (char *)funcname, lineno); + PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno); These changes will not change code, but they will make it much easier to check for errors in consts (cherry picked from commit e6be9b59a911626d6597fe148c32f0342bd2bd24) Co-authored-by: Andy Lester <andy@petdance.com>
* [3.8] bpo-39579: Fix Attribute end_col_offset to point at the current node ↵Lysandros Nikolaou2020-02-081-2/+3
| | | | | | | | | | | | | | | (GH-18405) (GH-18408) (cherry picked from commit d2e1098641f98594702ef29049c3c4a3f394786f) https://bugs.python.org/issue39579 Automerge-Triggered-By: @gvanrossum
* Fix compiler warning on Windows (GH-18012)Miss Islington (bot)2020-01-151-1/+1
| | | | | | | | | | | Python-ast.h contains a macro named Yield that conflicts with the Yield macro in Windows system headers. While Python-ast.h has an "undef Yield" directive to prevent this, it means that Python-ast.h must be included before Windows header files or we run into a re-declaration warning. In commit c96be811fa7d an include for pycore_pystate.h was added which indirectly includes Windows header files. In this commit we re-order the includes to fix this warning. (cherry picked from commit e92d39303feb1d3b4194c6a8275b1fc63b2153b2) Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* [3.8] bpo-39033: Fix NameError in zipimport during hash validation ↵Karthikeyan Singaravelan2020-01-141-271/+269
| | | | | | | | | | | (GH-17588) (GH-17642) Fix `NameError` in `zipimport` during hash validation and add a regression test. (cherry picked from commit 79f02fee1a542c440fd906fd54154c73fc0f8235) https://bugs.python.org/issue39033
* bpo-39235: Fix end location for genexp in call args (GH-17925)Miss Islington (bot)2020-01-091-8/+8
| | | | | | | | The fix changes copy_location() to require an extra node from which to extract the end location, and fixing all 5 call sites. https://bugs.python.org/issue39235 (cherry picked from commit a796d8ef9dd1af65f7e4d7a857b56f35b7cb6e78) Co-authored-by: Guido van Rossum <guido@python.org>
* bpo-29778: Fix incorrect NULL check in _PyPathConfig_InitDLLPath() (GH-17818)Miss Islington (bot)2020-01-061-1/+1
| | | | | (cherry picked from commit 7b79dc9200a19ecbac667111dffd58e314be02a8) Co-authored-by: Anthony Wee <awee@box.com>
* Fix constant folding optimization for positional only arguments (GH-17837)Miss Islington (bot)2020-01-051-0/+1
| | | | | (cherry picked from commit b121a4a45ff4bab8812a9b26ceffe5ad642f5d5a) Co-authored-by: Anthony Sottile <asottile@umich.edu>
* Fix SystemError when nested function has annotation on positional-only ↵Miss Islington (bot)2020-01-051-0/+2
| | | | | | | argument (GH-17826) (cherry picked from commit ec007cb43faf5f33d06efbc28152c7fdcb2edb9c) Co-authored-by: Anthony Sottile <asottile@umich.edu>
* Bring Python into the next decade. (GH-17801)Miss Islington (bot)2020-01-031-1/+1
| | | | | (cherry picked from commit 946b29ea0b3b386ed05e87e60b8617c9dc19cd53) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* bpo-39176: Improve error message for 'named assignment' (GH-17777) (GH-17778)Miss Islington (bot)2020-01-011-1/+1
| | | | | | | | (cherry picked from commit 37143a8e3b2e9245d52f4ddebbdd1c6121c96884) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com> Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* closes bpo-37446: resolve undefined behavior in Python/hamt.c (GH-17727)Miss Islington (bot)2019-12-311-1/+1
| | | | | (cherry picked from commit d0c92e81aa2171228a23cb2bed36f7dab975257d) Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
* [3.8] bpo-39080: Starred Expression's column offset fix when inside a CALL ↵Pablo Galindo2019-12-181-1/+1
| | | | | | | | | | | | | | | (GH-17645) (GH-17649) … Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com> (cherry picked from commit 50d4f12958bf806a4e1a1021d70cfd5d448c5cba) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> https://bugs.python.org/issue39080
* The comment in ast_for_namedexpr shouldn't include if_stmt (GH-17586)Miss Islington (bot)2019-12-151-3/+1
| | | | | | Automerge-Triggered-By: @gvanrossum (cherry picked from commit b08d3f71beab59653edfbbcf7b92a7bc8050d6b8) Co-authored-by: Guido van Rossum <guido@python.org>
* Fix elif start column offset when there is an else following (GH-17596) ↵Miss Islington (bot)2019-12-141-2/+2
| | | | | | | (GH-17600) (cherry picked from commit 5936a4ce914d42af97b9238e5090dedc8d5b0bd2) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* Add PYTHONUTF8 to commandline usage. (GH-17587)Miss Islington (bot)2019-12-141-0/+1
| | | | | | Co-Authored-By: Victor Stinner <vstinner@python.org> (cherry picked from commit 95826c773a9004fc5b3c89de55f800504685ab21) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* bpo-39031: Include elif keyword when producing lineno/col-offset info for ↵Miss Islington (bot)2019-12-131-2/+2
| | | | | | | | | | | | if_stmt (GH-17582) (GH-17589) 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>
* bpo-39008: Require Py_ssize_t for PySys_Audit formats rather than raise a ↵Miss Islington (bot)2019-12-091-1/+1
| | | | | | | deprecation warning (GH-17540) (cherry picked from commit b8cbe74c3498c617f0e73fd0cdc5c07f2c532092) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-38979: fix ContextVar "__class_getitem__" method (GH-17497)Miss Islington (bot)2019-12-081-3/+4
| | | | | | | | | | 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>
* bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisablehook ↵Steve Dower2019-11-283-33/+51
| | | | | are invoked (GH-17392) Also fixes some potential segfaults in unraisable hook handling.
* bpo-38823: Fix refleak in marshal init error path (GH-17260)Miss Islington (bot)2019-11-201-1/+4
| | | | | (cherry picked from commit 33b671e72450bf4b5a946ce0dde6b7fe21150108) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* closes bpo-37633: Reëxport some function compatibility wrappers for macros ↵Miss Islington (bot)2019-11-051-16/+16
| | | | | | | in ``pythonrun.h``. (GH-17056) (cherry picked from commit 62161ce989d7d4fe2b0e6899a54da20feeddc798) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* bpo-38640: Allow break and continue in always false while loops (GH-16992)Miss Skeleton (bot)2019-10-301-0/+8
| | | | | (cherry picked from commit 6c3e66a34b95fff07df0ad5086104dd637a091ce) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-38535: Fix positions for AST nodes for calls without arguments in ↵Miss Skeleton (bot)2019-10-261-2/+4
| | | | | | | decorators. (GH-16861) (cherry picked from commit 26ae9f6d3d755734c9f371b9356325afe5764813) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Fix typo in formatter_unicode (GH-16831)Miss Skeleton (bot)2019-10-251-1/+1
| | | | | | numbers's -> number's (cherry picked from commit 7320ec05f72fc27b25789fe76f8297644e7e7e0a) Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
* bpo-38540: Fix possible leak in PyArg_Parse for "esGH-" and "etGH-". (GH-16869)Miss Skeleton (bot)2019-10-211-2/+26
| | | | | (cherry picked from commit 5bc6a7c06eda20ba131ecba6752be0506d310181) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Typo fix - implemention should be implementation (GH-16806)Miss Islington (bot)2019-10-151-1/+1
| | | | | (cherry picked from commit 2798b60c55619d8981288b69c20ba4a09efc7b0b) Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
* bpo-38469: Handle named expression scope with global/nonlocal keywords ↵Miss Islington (bot)2019-10-141-3/+9
| | | | | | | | (GH-16755) (#16760) The symbol table handing of PEP572's assignment expressions is not resolving correctly the scope of some variables in presence of global/nonlocal keywords in conjunction with comprehensions. (cherry picked from commit fd5c414880b2e05720b9cf14ab0b0d7ae2b7d925) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* Correct signature of __build_class__ (GH-16735)Miss Islington (bot)2019-10-131-1/+1
| | | | | (cherry picked from commit e3babbd03cd2bcb3c85deabae3bc6976aa95a3c3) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.8] Typo fix: "throuhgh" should be "through". (GH-16713)Benjamin Peterson2019-10-111-1/+1
| | | | | (cherry picked from commit a8e0d3141e271b3c0fbb7399a911f0c3aa567e30) Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
* bpo-38425: Fix ‘res’ may be used uninitialized warning (GH-16688)Miss Islington (bot)2019-10-101-1/+2
| | | | | (cherry picked from commit a05fcd3c7adf6e3a0944da8cf80a3346882e9b3b) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* Typo fix: "empy" should be "empty". (GH-16666)Miss Islington (bot)2019-10-091-1/+1
| | | | | (cherry picked from commit 01171ebd966b0cd6352057799ad876dd1e07942e) Co-authored-by: Hansraj Das <raj.das.136@gmail.com>