summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* [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
|
* bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. (GH-378)INADA Naoki2017-03-011-6/+7
|
* bpo-29655: Fixed possible reference leaks in `import *`. (#301) (#348)Berker Peksag2017-02-271-1/+4
| | | | | Patch by Matthias Bussonnier. (cherry picked from commit 160edb43571311a3785785c1dfa784afc52d87be)
* bpo-28598: Support __rmod__ for RHS subclasses of str in % string formatting ↵Martijn Pieters2017-02-271-3/+9
| | | | operations (#95)
* bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX (GH-219)INADA Naoki2017-02-211-1/+1
| | | (cherry picked from commit 3a9ac827c7c87dffc60c4200323948551bcb6662)
* Issue #26729: Fixed __text_signature__ for sorted().Serhiy Storchaka2017-01-231-1/+1
|\ | | | | | | Patch by Erik Welch.
| * Issue #26729: Fixed __text_signature__ for sorted().Serhiy Storchaka2017-01-231-1/+1
| | | | | | | | Patch by Erik Welch.
| * Issue #29157: Prefer getrandom() over getentropy()Victor Stinner2017-01-091-200/+294
| | | | | | | | | | | | | | | | | | | | | | Copy and then adapt Python/random.c from default branch. Difference between 3.5 and default branches: * Python 3.5 only uses getrandom() in non-blocking mode: flags=GRND_NONBLOCK * If getrandom() fails with EAGAIN: py_getrandom() immediately fails and remembers that getrandom() doesn't work. * Python 3.5 has no _PyOS_URandomNonblock() function: _PyOS_URandom() works in non-blocking mode on Python 3.5
* | Issue #29327: Fixed a crash when pass the iterable keyword argument to sorted().Serhiy Storchaka2017-01-201-1/+2
| |
* | Issue #29157: Prefer getrandom() over getentropy()Victor Stinner2017-01-061-87/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dev_urandom() now calls py_getentropy(). Prepare the fallback to support getentropy() failure and falls back on reading from /dev/urandom. * Simplify dev_urandom(). pyurandom() is now responsible to call getentropy() or getrandom(). Enhance also dev_urandom() and pyurandom() documentation. * getrandom() is now preferred over getentropy(). The glibc 2.24 now implements getentropy() on Linux using the getrandom() syscall. But getentropy() doesn't support non-blocking mode. Since getrandom() is tried first, it's not more needed to explicitly exclude getentropy() on Solaris. Replace: "if defined(HAVE_GETENTROPY) && !defined(sun)" with "if defined(HAVE_GETENTROPY)" * Enhance py_getrandom() documentation. py_getentropy() now supports ENOSYS, EPERM & EINTR
* | merge 3.5 (#29057)Benjamin Peterson2017-01-021-1/+1
|\ \ | |/
| * only include sys/random.h if it seems like it might have something useful ↵Benjamin Peterson2017-01-021-1/+1
| | | | | | | | (#29057)
* | merge 3.5Benjamin Peterson2017-01-021-1/+1
|\ \ | |/
| * merge 3.4Benjamin Peterson2017-01-021-1/+1
| |\
| | * merge 3.3Benjamin Peterson2017-01-021-1/+1
| | |\
| | | * ring in 2017 for PythonBenjamin Peterson2017-01-021-1/+1
| | | |
* | | | merge 3.5 (#28932)Benjamin Peterson2016-12-201-1/+1
|\ \ \ \ | |/ / /
| * | | add a specific configure check for sys/random.h (closes #28932)Benjamin Peterson2016-12-201-1/+1
| | | |
* | | | Issue #25677: Merge SyntaxError caret positioning from 3.5Martin Panter2016-12-192-5/+2
|\ \ \ \ | |/ / /
| * | | Issue #25677: Correct syntax error caret for indented blocks.Martin Panter2016-12-112-5/+2
| | | | | | | | | | | | | | | | Based on patch by Michael Layzell.
* | | | Issue #26919: On Android, operating system data is now always encoded/decodedXavier de Gaye2016-12-151-5/+5
| | | | | | | | | | | | | | | | | | | | to/from UTF-8, instead of the locale encoding to avoid inconsistencies with os.fsencode() and os.fsdecode() which are already using UTF-8.
* | | | Issue #28896: Disable WindowsRegistryFinder by default.Steve Dower2016-12-121-56/+53
| | | |
* | | | Issue #28739: f-string expressions no longer accepted as docstrings andSerhiy Storchaka2016-12-112-7/+7
| | | | | | | | | | | | | | | | by ast.literal_eval() even if they do not include subexpressions.
* | | | Issue #28512: Fixed setting the offset attribute of SyntaxError bySerhiy Storchaka2016-12-111-8/+4
|\ \ \ \ | |/ / / | | | | | | | | PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
| * | | Issue #28512: Fixed setting the offset attribute of SyntaxError bySerhiy Storchaka2016-12-111-8/+4
| | | | | | | | | | | | | | | | PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
* | | | Issue #23722: improve __classcell__ compatibilityNick Coghlan2016-12-053-1184/+1218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling zero-argument super() in __init_subclass__ and __set_name__ involved moving __class__ initialisation to type.__new__. This requires cooperation from custom metaclasses to ensure that the new __classcell__ entry is passed along appropriately. The initial implementation of that change resulted in abruptly broken zero-argument super() support in metaclasses that didn't adhere to the new requirements (such as Django's metaclass for Model definitions). The updated approach adopted here instead emits a deprecation warning for those cases, and makes them work the same way they did in Python 3.5. This patch also improves the related class machinery documentation to cover these details and to include more reader-friendly cross-references and index entries.
* | | | Fix _PyGen_yf()Victor Stinner2016-11-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28782: Fix a bug in the implementation ``yield from`` when checking if the next instruction is YIELD_FROM. Regression introduced by WORDCODE (issue #26647). Reviewed by Serhiy Storchaka and Yury Selivanov.
* | | | Issue #27100: Fix ref leakRaymond Hettinger2016-11-221-1/+3
| | | |
* | | | Issue #27100: With statement reports missing __enter__ before __exit__. ↵Raymond Hettinger2016-11-221-4/+4
| | | | | | | | | | | | | | | | (Contributed by Jonathan Ellington.)
* | | | Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-207-16/+16
| | | | | | | | | | | | | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
* | | | Issue #28715: Added error checks for PyUnicode_AsUTF8().Serhiy Storchaka2016-11-202-3/+9
|\ \ \ \ | |/ / /