summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* bpo-43660: Fix crash when displaying exceptions with custom values for ↵Miss Islington (bot)2021-03-291-1/+2
| | | | | | | sys.stderr (GH-25075) (cherry picked from commit 09b90a037d18f5d4acdf1b14082e57bda78e85d3) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843) ↵Miss Islington (bot)2021-03-291-39/+79
| | | | | | | | | | | | | | | | | (GH-24906) Python no longer fails at startup with a fatal error if a command line argument contains an invalid Unicode character. The Py_DecodeLocale() function now escapes byte sequences which would be decoded as Unicode characters outside the [U+0000; U+10ffff] range. Use MAX_UNICODE constant in unicodeobject.c. (cherry picked from commit 9976834f807ea63ca51bc4f89be457d734148682) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-42780: Fix set_inheritable() for O_PATH file descriptors on Linux ↵cptpcrd2021-01-211-0/+7
| | | | | (GH-24172) (GH-24277) (cherry picked from commit 7dc71c425cf6aa6a4070a418dce5d95ca435c79f)
* Bring Python into the new year. (GH-24036)Miss Islington (bot)2021-01-011-1/+1
| | | | | (cherry picked from commit de6f20a6de48d63066b2cf5b317f50629f01d74a) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-26564: fix obsolete comment in traceback.c (GH-23819)Miss Islington (bot)2020-12-171-1/+2
| | | | | (cherry picked from commit 40125ab3252453bf205ed906e46bf9741c27bf9d) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
* bpo-32381: Fix PyRun_SimpleFileExFlags() encoding (GH-23642) (GH-23692) ↵Victor Stinner2020-12-081-92/+132
| | | | | | | | | | | | | | | (GH-23696) Fix encoding name when running a ".pyc" file on Windows: PyRun_SimpleFileExFlags() now uses the correct encoding to decode the filename. * Add pyrun_file() subfunction. * Add pyrun_simple_file() subfunction. * PyRun_SimpleFileExFlags() now calls _Py_fopen_obj() rather than _Py_fopen(). (cherry picked from commit b6d98c10fff6f320f8fdf595c3f9a05d8be4e31d) (cherry picked from commit f0e42ae03c41ec32fcb3064772f46ff7f2c5ff3b)
* bpo-42536: GC track recycled tuples (GH-23623) (GH-23652)Brandt Bucher2020-12-071-0/+6
| | | | | | | | | | | | | | | | | Several built-in and standard library types now ensure that their internal result tuples are always tracked by the garbage collector: - collections.OrderedDict.items - dict.items - enumerate - functools.reduce - itertools.combinations - itertools.combinations_with_replacement - itertools.permutations - itertools.product - itertools.zip_longest - zip Previously, they could have become untracked by a prior garbage collection. (cherry picked from commit 226a012d1cd61f42ecd3056c554922f359a1a35d)
* bpo-41686: Always create the SIGINT event on Windows (GH-23344) (GH-23347) ↵Victor Stinner2020-11-171-25/+2
| | | | | | | | | | (GH-23349) bpo-41686, bpo-41713: On Windows, the SIGINT event, _PyOS_SigintEvent(), is now created even if Python is configured to not install signal handlers (PyConfig.install_signal_handlers=0 or Py_InitializeEx(0)). (cherry picked from commit 05a5d697f4f097f37c5c1e2ed0e2338a33c3fb6a)
* bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332)Miss Skeleton (bot)2020-10-211-1/+1
| | | | | | | | Fix the compiler warning: format specifies type `wint_t` (aka `int`) but the argument has type `unsigned int` (cherry picked from commit c322948892438a387d752ec18d1eb512699a4d67) Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
* bpo-38324: Fix test__locale.py Windows failures (GH-20529)Miss Skeleton (bot)2020-10-201-2/+13
| | | | | | | Use wide-char _W_* fields of lconv structure on Windows Remove "ps_AF" from test__locale.known_numerics on Windows (cherry picked from commit f2312037e3a974d26ed3e23884f94c6af111a27a) Co-authored-by: TIGirardi <tiagoigirardi@gmail.com>
* bpo-41894: Fix UnicodeDecodeError while loading native module (GH-22466)Miss Skeleton (bot)2020-10-153-8/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running in a non-UTF-8 locale, if an error occurs while importing a native Python module (say because a dependent share library is missing), the error message string returned may contain non-ASCII code points causing a UnicodeDecodeError. PyUnicode_DecodeFSDefault is used for buffers which may contain filesystem paths. For consistency with os.strerror(), PyUnicode_DecodeLocale is used for buffers which contain system error messages. While the shortname parameter is always encoded in ASCII according to PEP 489, it is left decoded using PyUnicode_FromString to minimize the changes and since it should not affect the decoding (albeit _potentially_ slower). In dynload_hpux, since the error buffer contains a message generated from a static ASCII string and the module filesystem path, PyUnicode_DecodeFSDefault is used instead of PyUnicode_DecodeLocale as is used elsewhere. * bpo-41894: Fix bugs in dynload error msg handling For both dynload_aix and dynload_hpux, properly handle the possibility that decoding strings may return NULL and when such an error happens, properly decrement any previously decoded strings and return early. In addition, in dynload_aix, ensure that we pass the decoded string *object* pathname_ob to PyErr_SetImportError instead of the original pathname buffer. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit 2d2af320d94afc6561e8f8adf174c9d3fd9065bc) Co-authored-by: Kevin Adler <kadler@us.ibm.com>
* Fix compiler warnings in init_dump_ascii_wstr() (GH-22150)Miss Islington (bot)2020-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | Fix GCC 9.3 (using -O3) warnings on x86: initconfig.c: In function ‘init_dump_ascii_wstr’: initconfig.c:2679:34: warning: format ‘%lc’ expects argument of type ‘wint_t’, but argument 2 has type ‘wchar_t’ {aka ‘long int’} 2679 | PySys_WriteStderr("%lc", ch); initconfig.c:2682:38: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’} 2682 | PySys_WriteStderr("\\x%02x", ch); initconfig.c:2686:38: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’} 2686 | PySys_WriteStderr("\\U%08x", ch); initconfig.c:2690:38: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’} 2690 | PySys_WriteStderr("\\u%04x", ch); (cherry picked from commit 640e8e1d5f61d5868453d992da04bf4741327748) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-41525: Make the Python program help ASCII-only (GH-21836)Miss Islington (bot)2020-09-091-1/+1
| | | | | (cherry picked from commit 58de1dd6a8677bd213802c19204b827cb7134695) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.8] closes bpo-41533: Fix a potential memory leak when allocating a stack ↵Miss Islington (bot)2020-09-041-0/+3
| | | | | | | | | | (GH-21847) (GH-22015) Free the stack allocated in va_build_stack if do_mkstack fails and the stack is not a small_stack (cherry picked from commit 75c80b0bda89debf312f075716b8c467d411f90e) Co-authored-by: Tony Solomonik <tony.solomonik@gmail.com>
* bpo-41524: fix pointer bug in PyOS_mystr{n}icmp (GH-21845) (GH-22016)Miss Islington (bot)2020-08-301-7/+11
|
* Fix -Wstrict-prototypes warning in thread_pthread.h. (GH-21477)Miss Islington (bot)2020-07-151-1/+1
| | | | | (cherry picked from commit ea62a4bd54421693ed6b24a1bbd18ebed3bdb8f8) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* bpo-41218: Only mark async code with CO_COROUTINE. (GH-21357)Miss Islington (bot)2020-07-061-4/+6
| | | | | | | | 3.8.3 had a regression where compiling with ast.PyCF_ALLOW_TOP_LEVEL_AWAIT woudl agressively mark things are coroutine even if there were not. (cherry picked from commit bd46174a5a09a54e5ae1077909f923f56a7cf710) Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
* bpo-29778: Ensure python3.dll is loaded from correct locations when Python ↵Miss Islington (bot)2020-07-062-48/+0
| | | | | | | | | is embedded (GH-21297) (GH-21352) Also enables using debug build of `python3_d.dll` Reference: CVE-2020-15523 (cherry picked from commit dcbaa1b49cd9062fb9ba2b9d49555ac6cd8c60b5) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-41162: Clear audit hooks later during finalization (GH-21222)Steve Dower2020-07-031-7/+7
| | | Co-authored-by: Konge <zkonge@outlook.com>
* bpo-41180: Audit code.__new__ when unmarshalling (GH-21271)Miss Islington (bot)2020-07-031-0/+6
| | | | | (cherry picked from commit d160e0f8e283d0a8737644588b38e8c6a07c134f) Co-authored-by: tkmikan <36260601+tkmikan@users.noreply.github.com>
* [3.8] bpo-35975: Only use cf_feature_version if PyCF_ONLY_AST in cf_flags ↵Guido van Rossum2020-06-282-2/+3
| | | | (#21023)
* [3.8] bpo-41132: Use pymalloc allocator in the f-string parser (GH-21173) ↵Lysandros Nikolaou2020-06-271-7/+7
| | | | | (GH-21184) Automerge-Triggered-By: @pablogsal
* bpo-41094: Fix decoding errors with audit when open files. (GH-21095)Miss Islington (bot)2020-06-241-4/+19
| | | | | (cherry picked from commit 6c6810d98979add7a89391c3c38990d0859f7a29) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-41056: Fix reference to deallocated stack in pathconfig (Coverity) ↵Miss Islington (bot)2020-06-221-1/+1
| | | | | | | | | | (GH-21013) Reported by Coverity. (CID 1457554 RETURN_LOCAL) path0 is assigned as a pointer to this right before it goes out of scope. (cherry picked from commit 81328f30703bd7225e7e73aedb0994a7293ce190) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* bpo-40957: Fix refleak in _Py_fopen_obj() (GH-20827)Miss Islington (bot)2020-06-131-0/+1
| | | | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 9672912e8f90374fd31b37ca0fb7cefbc6f4c555) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-40834: Fix truncate when sending str object with channel (GH-20555)Miss Islington (bot)2020-06-131-1/+1
| | | | | (cherry picked from commit 29c117202e386bad1d66ae336e2fefa1a1809ee0) Co-authored-by: An Long <aisk@users.noreply.github.com>
* bpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)Miss Islington (bot)2020-06-061-0/+22
| | | | | (cherry picked from commit 68874a8502da440a1dc4746cf73262648b870aee) Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* bpo-40614: Respect feature version for f-string debug expressions (GH-20196) ↵Shantanu2020-06-061-0/+6
| | | | | | | (GH-20466) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com> (cherry picked from commit c116c94ff119485761460f1033cdee425bed0310)
* bpo-36290: Fix keytword collision handling in AST node constructors (GH-12382)Miss Islington (bot)2020-05-241-3/+24
| | | | | (cherry picked from commit c73914a562580ae72048876cb42ed8e76e2c83f9) Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
* [3.8] bpo-40663: Correctly handle annotations with subscripts in ↵Batuhan Taskaya2020-05-221-2/+19
| | | | | | | ast_unparse.c (GH-20156). (GH-20191) (cherry picked from commit 2135e10dc717c00d10d899d232bebfc59bb25032) Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
* bpo-35890: Use RegQueryInfoKeyW and CryptAcquireContextW explicitly (GH-19974)Miss Islington (bot)2020-05-181-2/+2
| | | | | (cherry picked from commit 98e42d1f882b9b59f587d538c562dbc7d11c64c3) Co-authored-by: Minmin Gong <gongminmin@msn.com>
* bpo-40650: Include winsock2.h in pytime.c, instead of a full windows.h ↵Miss Islington (bot)2020-05-181-1/+1
| | | | | | | (GH-20137) (cherry picked from commit f660567937277cc3a2cd53af77bbb18e905427e8) Co-authored-by: Minmin Gong <gongminmin@msn.com>
* bpo-40636: Clarify the zip built-in docstring. (GH-20118)Miss Islington (bot)2020-05-151-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | Clarify the zip built-in docstring. This puts much simpler text up front along with an example. As it was, the zip built-in docstring was technically correct. But too technical for the reader who shouldn't _need_ to know about `__next__` and `StopIteration` as most people do not need to understand the internal implementation details of the iterator protocol in their daily life. This is a documentation only change, intended to be backported to 3.8; it is only tangentially related to PEP-618 which might offer new behavior options in the future. Wording based a bit more on enumerate per Brandt's suggestion. This gets rid of the legacy wording paragraph which seems too tied to implementation details of the iterator protocol which isn't relevant here. Co-authored-by: Brandt Bucher <brandtbucher@gmail.com> (cherry picked from commit 6a5d3ff67644af42b1a781be2eacb2e82913441c) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* bpo-40527: Fix command line argument parsing (GH-19955)Miss Islington (bot)2020-05-061-7/+16
| | | | | (cherry picked from commit 2668a9a5aa506a048aef7b4881c8dcf6b81c6870) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.8] bpo-40417: Fix deprecation warning in PyImport_ReloadModule (GH-19750) ↵Robert Rouhani2020-05-061-7/+7
| | | | | | | | (GH-19934) Automerge-Triggered-By: @brettcannon. (cherry picked from commit f40bd466bf14029e2687e36e965875adf9d4be1a) Co-authored-by: Robert Rouhani <robert.rouhani@gmail.com>
* bpo-40412: Nullify inittab_copy during finalization (GH-19746)Miss Islington (bot)2020-05-011-0/+1
| | | | | | | | | | | | Otherwise we leave a dangling pointer to free'd memory. If we then initialize a new interpreter in the same process and call PyImport_ExtendInittab, we will (likely) crash when calling PyMem_RawRealloc(inittab_copy, ...) since the pointer address is bogus. Automerge-Triggered-By: @brettcannon (cherry picked from commit 64224a4727321a8dd33e6f769edda401193ebef0) Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
* [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>