summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* [3.6] bpo-31592: Fix an assertion failure in Python parser in case of a bad ↵Miss Islington (bot)2017-09-301-12/+16
| | | | | unicodedata.normalize(). (GH-3767) (#3836) (cherry picked from commit 7dc46d8cf5854d9f4ce3271b29c21aea4872e8ad)
* [3.6] bpo-31285: Remove splitlines identifier from Python/_warnings.c ↵Miss Islington (bot)2017-09-291-3/+0
| | | | | | (GH-3803) (#3829) (forgot to remove it in GH-3219) (cherry picked from commit 8b4ff53c440dfcde40fbeb02c5e666c85190528f)
* [3.6] bpo-31588: Validate return value of __prepare__() methods (GH-3790)Miss Islington (bot)2017-09-271-0/+7
| | | | | | | | | | | Class execution requires that __prepare__() methods return a proper execution namespace. Check for that immediately after calling __prepare__(), rather than passing it through to the code execution machinery and potentially triggering SystemError (in debug builds) or a cryptic TypeError (in release builds). Patch by Oren Milman. (cherry picked from commit 5837d0418f47933b2e3c139bdee8a79c248a943c)
* [3.6] bpo-31285: Fix an assertion failure and a SystemError in ↵Serhiy Storchaka2017-09-271-3/+1
| | | | | warnings.warn_explicit. (GH-3219) (#3775) (cherry picked from commit 91fb0afe181986b48abfc6092dcca912b39de51d)
* [3.6] bpo-31492: Fix assertion failures in case of a module with a bad ↵Serhiy Storchaka2017-09-271-0/+4
| | | | | __name__ attribute. (GH-3620). (#3773) (cherry picked from commit 6db7033192cd537ca987a65971acb01206c3ba82)
* [3.6] bpo-31566: Fix an assertion failure in _warnings.warn() in case of a ↵Miss Islington (bot)2017-09-241-3/+4
| | | | | bad __name__ global. (GH-3717) (#3730) (cherry picked from commit 5d3e80021ab33360191eb0fbff34e0246c913884)
* [3.6] bpo-31315: Fix an assertion failure in imp.create_dynamic(), when ↵Miss Islington (bot)2017-09-191-0/+5
| | | | | spec.name is not a string. (GH-3257) (#3653) (cherry picked from commit 9974e1bcf3d0cec9b38b39b39b7ec8a1ebd9ef54)
* [3.6] bpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in case ↵Miss Islington (bot)2017-09-141-1/+1
| | | | | of an exception with a bad __module__ attribute. (GH-3539) (#3556) (cherry picked from commit f6e61df01536493f1280cd07639c7ff9bffb2cdc)
* [3.6] bpo-30923: Silence fall-through warnings included in -Wextra since ↵Victor Stinner2017-09-129-14/+27
| | | | | | | | | | | | | | | | gcc-7.0 (#3518) * bpo-30923: Disable warning that has been part of -Wextra since gcc-7.0. (#3142) (cherry picked from commit d73a960c575207539c3f9765cff26d4fff400b45) * bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. (#3157) (cherry picked from commit f432a3234f9f2ee09bd40be03e06bf72865ee375) * bpo-31275: Small refactoring to silence a fall-through warning. (#3206) (cherry picked from commit 138753c1b96b5e06a5c5d409fa4cae5e2fe1108b)
* [3.6] bpo-31416: Fix assertion failures in case of a bad warnings.filters or ↵Serhiy Storchaka2017-09-121-3/+16
| | | | | | warnings.defaultaction. (GH-3496) (#3509) Patch by Oren Milman.. (cherry picked from commit 9d984fd2b097c8c29479d1c3eb740995fe1ccb0d)
* [3.6] bpo-31373: remove overly strict float range checks (GH-3486) (#3495)Benjamin Peterson2017-09-121-4/+0
| | | | | | This undoes a853a8ba7850381d49b284295dd6f0dc491dbe44 except for the pytime.c parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be rounded into finite floats. Tests were added to very this behavior. (cherry picked from commit 2bb69a5b4e7f96cb35d1b28aa7b7b3974b351f59)
* [3.6] bpo-31411: Prevent raising a SystemError in case warnings.onceregistry ↵Serhiy Storchaka2017-09-111-1/+7
| | | | | is not a dictionary. (GH-3485). (#3494) (cherry picked from commit 252033d50effa08046ac34fcc406bc99796ab88b)
* [3.6] bpo-29526: Add reference to help('FORMATTING') in format() builtin ↵Serhiy Storchaka2017-09-112-4/+8
| | | | | (GH-166). (#3491) (cherry picked from commit 2e6bb4484ee1b0da67d1dfcf0816c58602daa5a0)
* [3.6] bpo-26669: Fix nan arg value error in pytime.c (GH-3085) (GH-3467) Miss Islington (bot)2017-09-091-0/+14
| | | | | | * Modify NaN check function and error message * Fix pytime.c when arg is nan * fix whitespace (cherry picked from commit 829dacce4fca60fc3c3367980e75e21dfcdbe6be)
* [3.6] bpo-31393: Fix the use of PyUnicode_READY(). (GH-3451). (#3453)Serhiy Storchaka2017-09-081-7/+10
| | | (cherry picked from commit e3b2b4b8d9e751b49e3550cb83ba39b54fdc377c)
* [3.6] bpo-30640: Fix undefined behavior in _PyFunction_FastCallDict() and ↵Zackery Spytz2017-09-081-2/+3
| | | | | | PyEval_EvalCodeEx() (GH-2919) (#2964) k + 1 was calculated with k = NULL.. (cherry picked from commit c6ea8974e2d939223bfd6d64ee13ec89c090d2e0)
* [3.6] fixes bpo-31373: fix undefined floating-point demotions (GH-3396) (#3424)Miss Islington (bot)2017-09-072-16/+21
| | | (cherry picked from commit a853a8ba7850381d49b284295dd6f0dc491dbe44)
* bpo-30465: Fix lineno and col_offset in fstring AST nodes (GH-1800) (gh-3409)Miss Islington (bot)2017-09-071-5/+67
| | | | For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly. (cherry picked from commit e7c566caf177afe43b57f0b2723e723d880368e8)
* bpo-31095: fix potential crash during GC (GH-3195)INADA Naoki2017-09-041-0/+2
| | | (cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
* [3.6] bpo-31070: Fix a race condition in importlib _get_module_lock(). ↵Serhiy Storchaka2017-08-091-1477/+1481
| | | | | (GH-3033). (#3038) (cherry picked from commit 9b0d1d647e3d2ec9d299e5c9f49b02fbbb810a5a)
* Fix a shadow-compatible-local warning (#2181)Yuan Chao Chou2017-08-041-165/+165
| | | | Change the shadowing naming, 'value' (Python-ast.c:4686), to 'val' to prevent the variables from being misused.
* [3.6] bpo-31071: Avoid masking original TypeError in call with * unpacking ↵Serhiy Storchaka2017-08-031-29/+34
| | | | | | (GH-2957) (#2991) when other arguments are passed. (cherry picked from commit 25e4f77)
* bpo-30891: Fix again importlib _find_and_load() (#2665) (#2801)Victor Stinner2017-07-211-341/+342
| | | | | | | | | | Use sys.modules.get() in the "with _ModuleLockManager(name):" block to protect the dictionary key with the module lock and use an atomic get to prevent race condition. Remove also _bootstrap._POPULATE since it was unused (_bootstrap_external now has its own _POPULATE object), add a new _SENTINEL object instead. (cherry picked from commit e72b1359f81d1dd42bd8a5c5cc2b3928b74f8023)
* [3.6] bpo-30876: Relative import from unloaded package now reimports the ↵Serhiy Storchaka2017-07-162-371/+356
| | | | | | | | | package (GH-2639) (#2676) instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError. (cherry picked from commit 8a9cd20edca7d01b68292036029ae3735ce65edd)
* bpo-30891: Fix importlib _find_and_load() race condition (#2646) (#2651)Victor Stinner2017-07-102-1530/+1518
| | | | | | | * Rewrite importlib _get_module_lock(): it is now responsible to hold the imp lock directly. * _find_and_load() now holds the module lock to check if name is in sys.modules to prevent a race condition (cherry picked from commit 4f9a446f3fb42f800e73cd9414dd1eccb3ca4fa7)
* [3.6] bpo-30814: Fixed a race condition when import a submodule from a ↵Serhiy Storchaka2017-07-062-311/+294
| | | | | package. (GH-2580). (#2598) (cherry picked from commit b4baacee1adc06edbe30ac7574d17a8cd168e2e0)
* [3.6] bpo-30854: Fix compile error when --without-threads (GH-2581) (#2583)Masayuki Yamamoto2017-07-051-1/+1
| | | | | | * bpo-30854: Fix compile error when --without-threads * bpo-30854: fix news (cherry picked from commit 0c3116309307ad2c7f8e2d2096612f4ab33cbb62)
* [3.6] bpo-30703: Improve signal delivery (GH-2415) (#2527)Antoine Pitrou2017-07-011-21/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [3.6] bpo-30703: Improve signal delivery (GH-2415) * Improve signal delivery Avoid using Py_AddPendingCall from signal handler, to avoid calling signal-unsafe functions. * Remove unused function * Improve comments * Add stress test * Adapt for --without-threads * Add second stress test * Add NEWS blurb * Address comments @haypo. (cherry picked from commit c08177a1ccad2ed0d50898c2731b518c631aed14) * bpo-30796: Fix failures in signal delivery stress test (#2488) * bpo-30796: Fix failures in signal delivery stress test setitimer() can have a poor minimum resolution on some machines, this would make the test reach its deadline (and a stray signal could then kill a subsequent test). * Make sure to clear the itimer after the test
* [3.6] bpo-13617: Reject embedded null characters in wchar* strings. ↵Serhiy Storchaka2017-06-282-8/+19
| | | | | | | | | | (GH-2302) (#2462) Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.. (cherry picked from commit f7eae0adfcd4c50034281b2c69f461b43b68db84)
* [3.6] bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to ↵Antoine Pitrou2017-06-261-45/+50
| | | | | | | | | | | | | (GH-2403) (#2418) * bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to lock This is especially important if PyThread_acquire_lock() is called reentrantly (for example from a signal handler). * Update 2017-06-26-14-29-50.bpo-30765.Q5iBmf.rst * Avoid core logic when taking the mutex failed (cherry picked from commit f84ac420c2af98339678744953869cad3c253281)
* [3.6] bpo-30682: Removed a too-strict assertion that failed for certain ↵Serhiy Storchaka2017-06-161-2/+2
| | | | | | f-strings. (GH-2232) (#2242) This caused a segfault on eval("f'\\\n'") and eval("f'\\\r'") in debug build.. (cherry picked from commit 11e97f2f80bf65cc828c127eafc95229df35d403)
* [3.6] bpo-30626: Fix error handling in PyImport_Import(). (GH-2103) (#2221)Serhiy Storchaka2017-06-151-2/+6
| | | | | In rare circumstances PyImport_Import() could return NULL without raising an error. (cherry picked from commit 145541c)
* bpo-30604: Fix __PyCodeExtraState_Get() prototype (#2152)Victor Stinner2017-06-131-2/+2
| | | | | | | Replace __PyCodeExtraState_Get() with __PyCodeExtraState_Get(void) to fix the following GCC warning: ./Include/pystate.h:63:1: warning: function declaration isn't a prototype [-Wstrict-prototypes] __PyCodeExtraState* __PyCodeExtraState_Get();
* [3.6] bpo-30604: Move co_extra_freefuncs to interpreter state to avoid ↵Dino Viehland2017-06-132-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | crashes in threads (#2015) * Move co_extra_freefuncs to interpreter state to avoid crashes in multi-threaded scenarios involving deletion of code objects * Don't require that extra be zero initialized * Build test list instead of defining empty test class * Ensure extra is always assigned on success * Keep the old fields in the thread state object, just don't use them Add new linked list of code extra objects on a per-interpreter basis so that interpreter state size isn't changed * Rename __PyCodeExtraState_Get and add comment about it going away in 3.7 Fix sort order of import's in test_code.py * Remove an extraneous space * Remove docstrings for comments * Touch up formatting * Fix casing of coextra local * Fix casing of another variable * Prefix PyCodeExtraState with __ to match C API for getting it * Update NEWS file for bpo-30604
* [3.6] bpo-30039: Don't run signal handlers while resuming a yield from stack ↵Yury Selivanov2017-06-091-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-1081) (#1640) If we have a chain of generators/coroutines that are 'yield from'ing each other, then resuming the stack works like: - call send() on the outermost generator - this enters _PyEval_EvalFrameDefault, which re-executes the YIELD_FROM opcode - which calls send() on the next generator - which enters _PyEval_EvalFrameDefault, which re-executes the YIELD_FROM opcode - ...etc. However, every time we enter _PyEval_EvalFrameDefault, the first thing we do is to check for pending signals, and if there are any then we run the signal handler. And if it raises an exception, then we immediately propagate that exception *instead* of starting to execute bytecode. This means that e.g. a SIGINT at the wrong moment can "break the chain" – it can be raised in the middle of our yield from chain, with the bottom part of the stack abandoned for the garbage collector. The fix is pretty simple: there's already a special case in _PyEval_EvalFrameEx where it skips running signal handlers if the next opcode is SETUP_FINALLY. (I don't see how this accomplishes anything useful, but that's another story.) If we extend this check to also skip running signal handlers when the next opcode is YIELD_FROM, then that closes the hole – now the exception can only be raised at the innermost stack frame. This shouldn't have any performance implications, because the opcode check happens inside the "slow path" after we've already determined that there's a pending signal or something similar for us to process; the vast majority of the time this isn't true and the new check doesn't run at all.. (cherry picked from commit ab4413a7e9bda95b6fcd517073e2a51dafaa1624)
* [3.6] bpo-30529: Fix errors for invalid whitespaces in f-string ↵Serhiy Storchaka2017-06-081-24/+7
| | | | | | | | subexpressions. (GH-1888) (#2013) 'invalid character in identifier' now is raised instead of 'f-string: empty expression not allowed' if a subexpression contains only whitespaces and they are not accepted by Python parser. (cherry picked from commit 2e9cd58)
* [3.6] bpo-30567: Fix refleak in sys.getwindowsversion (GH-1940) (#1970)Serhiy Storchaka2017-06-061-4/+4
| | | (cherry picked from commit 48fb766)
* [3.6] bpo-29104: Fixed parsing backslashes in f-strings. (GH-490) (#1812)Serhiy Storchaka2017-05-251-21/+32
| | | (cherry picked from commit 0cd7a3f)
* [3.6] bpo-30395 _PyGILState_Reinit deadlock fix (GH-1734) (#1740)Łukasz Langa2017-05-231-0/+4
| | | | | head_lock could be held by another thread when fork happened. We should reset it to avoid deadlock. (cherry picked from commit f82c951d1c5416f3550d544e50ff5662d3836e73)
* bpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480) (#1529)Xiang Zhang2017-05-101-1/+1
|
* bpo-30225: Fix is_valid_fd() on macOS Tiger (#1443) (#1449)Victor Stinner2017-05-041-0/+9
| | | | | | is_valid_fd() now uses fstat() instead of dup() on macOS to return 0 on a pipe when the other side of the pipe is closed. fstat() fails with EBADF in that case, whereas dup() succeed. (cherry picked from commit 1c4670ea0cc3d208121af11b9b973e6bb268e570)
* bpo-29935: Fixed error messages in the index() method of tuple, list and ↵Serhiy Storchaka2017-03-301-5/+21
| | | | | | deque (#887) (#907) when pass indices of wrong type. (cherry picked from commit d4edfc9abffca965e76ebc5957a92031a4d6c4d4)
* bpo-29859: Fix error messages from return codes for pthread_* calls (GH-753)INADA Naoki2017-03-211-11/+13
| | | (cherry picked from commit d7fa6b259e00fca04dbf816bfcf4115fdda14bb7)
* [3.6] bpo-8256: Fixed possible failing or crashing input() (#641)Serhiy Storchaka2017-03-121-5/+16
| | | | if attributes "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not strings.
* bpo-29746: Update marshal docs to Python 3. (#547) (#631)Serhiy Storchaka2017-03-121-14/+12
| | | (cherry picked from commit c611a5b1d4fab0123bf622f06c3bfa510221dc32)
* bpo-29770: remove outdated PYO related info (GH-590) (GH-612)Xiang Zhang2017-03-111-1/+1
|
* bpo-29619: Convert st_ino using unsigned integer (#557) (#584)Victor Stinner2017-03-091-2/+2
| | | | | | | bpo-29619: os.stat() and os.DirEntry.inodeo() now convert inode (st_ino) using unsigned integers. (cherry picked from commit 0f6d73343d342c106cda2219ebb8a6f0c4bd9b3c) (Misc/NEWS conflict handled manually.)
* Refresh Python/importlib.h and Python/importlib_external.h (#464)Ned Deily2017-03-042-2/+2
|
* [3.6] bpo-27593: Get SCM build info from git instead of hg. (#446) (#454)Ned Deily2017-03-041-3/+3
| | | | | | | | | | | * bpo-27593: Get SCM build info from git instead of hg. (#446) sys.version and the platform module python_build(), python_branch(), and python_revision() functions now use git information rather than hg when building from a repo. Based on original patches by Brett Cannon and Steve Dower. (cherry picked from commit 5c4b0d063aba0a68c325073f5f312a2c9f40d178)
* bpo-28893: Set __cause__ for errors in async iteration protocol (#407)Yury Selivanov2017-03-031-3/+3
|