summaryrefslogtreecommitdiff
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* [3.6] Bring Python into the new year. (GH-24036). (GH-24054)Dong-hee Na2021-01-021-1/+1
| | | | | (cherry picked from commit de6f20a6de48d63066b2cf5b317f50629f01d74a) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* [3.6] bpo-29778: Ensure python3.dll is loaded from correct locations when ↵Steve Dower2020-07-061-2/+0
| | | | | | | | | | | 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
* [3.6] Bring Python into the next decade. (GH-17804)Benjamin Peterson2020-01-021-1/+1
| | | | | (cherry picked from commit 946b29ea0b3b386ed05e87e60b8617c9dc19cd53) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [3.6] Bump copyright years to 2019. (GH-11407)Benjamin Peterson2019-01-021-1/+1
| | | (cherry picked from commit 9a69ae8a78785105ded02b083b2e5cd2dd939307)
* bpo-35444: Fix error handling when fail to look up builtin "getattr". ↵Miss Islington (bot)2018-12-111-0/+14
| | | | | | | | (GH-11047) (GH-11107) (GH-11108) (cherry picked from commit bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d) (cherry picked from commit 3cae16d2e98ffaa89ddd311df70a857dfaff4020) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.6] bpo-35454: Fix miscellaneous minor issues in error handling. ↵Serhiy Storchaka2018-12-115-6/+15
| | | | | | (GH-11077) (GH-11106) (cherry picked from commit 8905fcc85a6fc3ac394bc89b0bbf40897e9497a6)
* bpo-35441: Remove dead and buggy code related to PyList_SetItem(). (GH-11033)Miss Islington (bot)2018-12-082-3/+3
| | | | | | | | | | | | 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>
* bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. ↵Serhiy Storchaka2018-12-073-5/+14
| | | | | | | | | (GH-11015) (GH-11020) (GH-11026) (cherry picked from commit 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9) (cherry picked from commit 602d307ac5e8a2da38a193dca3bdfef5994dfe67) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-35414: Add a missing Py_INCREF(Py_None) in PyState_RemoveModule(). ↵Miss Islington (bot)2018-12-041-0/+1
| | | | | | | (GH-10914) (cherry picked from commit 2a893430c9c8378cbdfac95895a64fa07aaff9ed) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) (GH-10822)Victor Stinner2018-11-301-4/+36
| | | | | | | | | 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)
* [3.6] bpo-33029: Fix signatures of getter and setter functions. (GH-10746) ↵Serhiy Storchaka2018-11-271-1/+2
| | | | | | (GH-10749) Fix also return type for few other functions (clear, releasebuffer). (cherry picked from commit d4f9cf5545d6d8844e0726552ef2e366f5cc3abd)
* bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623) (GH-10718) ↵Victor Stinner2018-11-261-18/+22
| | | | | | | | | | | | | (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)
* bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) (GH-10619) ↵Victor Stinner2018-11-202-4/+17
| | | | | | | | | | | | | | | | | | (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)
* Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576)Miss Islington (bot)2018-11-161-1/+3
| | | | | | | 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>
* bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)Miss Islington (bot)2018-11-122-3/+3
| | | | | | | 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>
* [3.6] bpo-35214: Initial clang MemorySanitizer support (GH-10479) (GH-10493)Gregory P. Smith2018-11-122-1/+12
| | | | | | | | | | | | | | | | 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.
* bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418) ↵Gregory P. Smith2018-11-081-6/+6
| | | | | | | | | | | | | | | | (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)
* [3.6] bpo-35133: Fix mistakes when concatenate string literals on different ↵Serhiy Storchaka2018-11-051-1/+1
| | | | | | | | | | | 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)
* bpo-26558: Fix Py_FatalError() with GIL released (GH-10267) (GH-10270)Victor Stinner2018-11-011-10/+26
| | | | | | | 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)
* [3.6] bpo-24658: Fix read/write greater than 2 GiB on macOS (GH-1705) (GH-9937)Stéphane Wirtel2018-10-181-19/+5
| | | | | On macOS, fix reading from and writing into a file with a size larger than 2 GiB. (cherry picked from commit 74a8b6ea7e0a8508b13a1c75ec9b91febd8b5557)
* Fix an incorrect check in compiler_try_except(). (GH-9810)Miss Islington (bot)2018-10-121-1/+2
| | | | | (cherry picked from commit 53ebf4b0709f431b7262aa5daccef7eafde7383e) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* Fix a possible decref of a borrowed reference in symtable.c. (GH-9786)Miss Islington (bot)2018-10-101-2/+4
| | | | | (cherry picked from commit fc439d20de32b0ebccca79a96e31f83b85ec4eaf) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* closes bpo-34868: Improve error message with '_' is combined with an invalid ↵Miss Islington (bot)2018-10-011-8/+9
| | | | | | | type specifier. (GH-9666) (cherry picked from commit cbda8fc5d76b10bcbb92d927537576c229143836) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* Drop confusing commented out code in pystrtod.c (GH-6072) (GH-9587)Victor Stinner2018-09-261-2/+0
| | | | | | | | | 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)
* bpo-34588: Fix an off-by-one error in traceback formatting. (GH-9077)Miss Islington (bot)2018-09-101-14/+16
| | | | | | | | | | | 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>
* bpo-34527: Fix FreeBSD with POSIX locale (GH-8975)Victor Stinner2018-08-281-1/+1
| | | | | 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".
* bpo-34503: Fix refleak in PyErr_SetObject() (GH-8934)Miss Islington (bot)2018-08-261-0/+1
| | | | | (cherry picked from commit a2eefa67542c25617a58c03a27c17fd48e2a0856) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* closes bpo-34474: Python/bltinmodule.c: Add missing NULL check in ↵Miss Islington (bot)2018-08-241-0/+5
| | | | | | | | builtin_sum_impl() (GH-8872) Reported by Svace static analyzer. (cherry picked from commit 2b824b2538c4a5f9f520c5de8a1eae5a0c181a94) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). ↵Miss Islington (bot)2018-08-221-0/+2
| | | | | | | | (GH-8852) Reported by Svace static analyzer. (cherry picked from commit 28853a249b1d0c890b7e9ca345290bb8c1756446) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* bpo-34084: Fix setting an error message for the "Barry as BDFL" easter egg. ↵Miss Islington (bot)2018-07-241-0/+4
| | | | | | | (GH-8262) (GH-8424) (cherry picked from commit aba24ff3601ddc86b85e01880a8be596fb799287) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-34087: Backport tests for int/float/complex (GH-8274)INADA Naoki2018-07-141-0/+2
| | | | | | Cherrypick tests from 16dfca4d829e45f36e71bf43f83226659ce49315 While the regression is not in 3.6, it's worth to backport test cases to 3.6 branch too.
* bpo-34080: Fix a memory leak in the compiler. (GH-8222) (GH-8257)Miss Islington (bot)2018-07-121-1/+1
| | | | | (cherry picked from commit 993030aac576710a46b3dd0b4864f819d4a94145) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-23927: Make getargs.c skipitem() skipping 'w*'. (GH-8192)Miss Islington (bot)2018-07-111-1/+3
| | | | | (cherry picked from commit 504373c59b48f1ea12132d515459022730db6047) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.6] bpo-34066: Disabled interruption before SETUP_WITH and ↵Serhiy Storchaka2018-07-091-4/+11
| | | | | | | | | | 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>
* bpo-24596: Decref module in PyRun_SimpleFileExFlags() on SystemExit ↵Miss Islington (bot)2018-07-031-1/+2
| | | | | | | | | (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>
* bpo-33451: Close pyc files before calling PyEval_EvalCode() (GH-7884)Miss Islington (bot)2018-06-231-6/+9
| | | | | | Directly executed pyc files were being kept open longer than necessary. (cherry picked from commit ea737751b10fff752aafed0231e8a02b82ba365d) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-31849: Fix warning in pyhash.c (GH-6799)Miss Islington (bot)2018-06-041-2/+2
| | | | | (cherry picked from commit a8eb58546b37a7cd5f332f019bb07388f5212c2d) Co-authored-by: A. Jesse Jiryu Davis <jesse@emptysquare.net>
* [3.6] bpo-32591: fix abort in _PyErr_WarnUnawaitedCoroutine during shutdown ↵T. Wouters2018-05-311-0/+7
| | | | | | | | | | | | | | | | | | | | | | | (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>
* bpo-33677: Fix signatures of tp_clear handlers for AST and deque. (GH-7196) ↵Miss Islington (bot)2018-05-311-1/+2
| | | | | | | (GH-7269) (cherry picked from commit a5c42284e69fb309bdd17ee8c1c120d1be383012) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-28055: Fix unaligned accesses in siphash24(). (GH-6123)Miss Islington (bot)2018-05-131-13/+13
| | | | | | | | | | 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>
* [3.6] bpo-33330: Improve error handling in PyImport_Cleanup(). (GH-6564). ↵Serhiy Storchaka2018-04-261-8/+20
| | | | | | (GH-6604) (cherry picked from commit e9d9494d6b2a5e0c2d48d22c7f0d5e95504b4f7e)
* [3.6] bpo-29673: fix gdb scripts pystack and pystackv (GH-6126) (GH-6400)Miss Islington (bot)2018-04-061-1/+1
| | | | | (cherry picked from commit 3a9ccee0e5dbf7d67f5ab79f6095755969db117c) Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
* bpo-33231: Fix potential leak in normalizestring() (GH-6386)Miss Islington (bot)2018-04-061-2/+0
| | | | | (cherry picked from commit 0c1c4563a65ac451021d927058e4f25013934eb2) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* bpo-29922: Improve error messages in 'async with' (GH-6352)Miss Islington (bot)2018-04-041-0/+25
| | | | | | when __aenter__() or __aexit__() return non-awaitable object. (cherry picked from commit a68f2f0578bbf812fa2264d0e0bb388340d6e230) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.6] bpo-33132: Fix reference counting issues in the compiler. (GH-6209). ↵Serhiy Storchaka2018-03-311-20/+11
| | | | | | (GH-6321) (cherry picked from commit a95d98607efe0c43475b354543e49bf8e240bc6f)
* [3.6] bpo-33041: Fixed jumping if the function contains an "async for" loop. ↵Serhiy Storchaka2018-03-231-26/+17
| | | | | | (GH-6154). (GH-6199) (cherry picked from commit b9744e924ca07ba7db977e5958b91cd8db565632)
* [3.6] bpo-33021: Release the GIL during fstat() calls (GH-6019) (GH-6160)Miss Islington (bot)2018-03-201-1/+6
| | | | | | | | | | | | | | | | 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>
* [3.7] bpo-33041: Add missed error checks when compile "async for" (GH-6053) ↵Miss Islington (bot)2018-03-101-13/+7
| | | | | | | | | | | (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>
* Revert "[3.6] bpo-32303 - Consistency fixes for namespace loaders (GH-5481) ↵Barry Warsaw2018-02-262-1434/+1433
| | | | | (#5504)" (#5911) This reverts commit a71397fb6603d0fe673acd7765c74699cd28fe7b.
* bpo-32869: Fix incorrect dst buffer size for MultiByteToWideChar (GH-5739)Miss Islington (bot)2018-02-181-1/+2
| | | | | | | 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>