summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* bpo-29922: Improve error messages in 'async with' (GH-6352)Serhiy Storchaka2018-04-021-0/+25
| | | when __aenter__() or __aexit__() return non-awaitable object.
* bpo-33132: Fix more reference counting issues in the compiler. (GH-6323)Serhiy Storchaka2018-03-311-4/+2
|
* bpo-33053: -m now adds *starting* directory to sys.path (GH-6231)Nick Coghlan2018-03-251-9/+21
| | | | | | | | | | | | Historically, -m added the empty string as sys.path zero, meaning it resolved imports against the current working directory, the same way -c and the interactive prompt do. This changes the sys.path initialisation to add the *starting* working directory as sys.path[0] instead, such that changes to the working directory while the program is running will have no effect on imports when using the -m switch.
* bpo-33042: Fix pre-initialization sys module configuration (GH-6157)Nick Coghlan2018-03-251-0/+162
| | | | | | | | | - new test case for pre-initialization of sys.warnoptions and sys._xoptions - restored ability to call these APIs prior to Py_Initialize - updated the docs for the affected APIs to make it clear they can be called before Py_Initialize - also enhanced the existing embedding test cases to check for expected settings in the sys module
* bpo-33132: Fix reference counting issues in the compiler. (GH-6209)Serhiy Storchaka2018-03-241-19/+12
|
* bpo-32932: More revealing error message when non-str objects in __all__ ↵Xiang Zhang2018-03-241-1/+27
| | | | (GH-5848)
* bpo-33041: Rework compiling an "async for" loop. (#6142)Serhiy Storchaka2018-03-234-209/+155
| | | | | | | | * Added new opcode END_ASYNC_FOR. * Setting global StopAsyncIteration no longer breaks "async for" loops. * Jumping into an "async for" loop is now disabled. * Jumping out of an "async for" loop no longer corrupts the stack. * Simplify the compiler.
* bpo-32489: Allow 'continue' in 'finally' clause. (GH-5822)Serhiy Storchaka2018-03-181-4/+0
|
* bpo-33021: Release the GIL during fstat() calls (GH-6019)Nir Soffer2018-03-111-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()
* Drop confusing commented out code in pystrtod.c (GH-6072)Siddhesh Poyarekar2018-03-111-2/+0
|
* bpo-32925: Optimized iterating and containing test for literal lists (GH-5842)Serhiy Storchaka2018-03-111-2/+17
| | | | | consisting of non-constants: `x in [a, b]` and `for x in [a, b]`. The case of all constant elements already was optimized.
* bpo-32946: Speed up "from ... import ..." from non-packages. (GH-5873)Serhiy Storchaka2018-03-112-262/+273
|
* bpo-33041: Add missed error checks when compile "async for" (#6053)Serhiy Storchaka2018-03-101-14/+7
| | | and remove redundant code.
* bpo-33041: Fixed bytecode generation for "async for" with a complex target. ↵Serhiy Storchaka2018-03-101-2/+2
| | | | | | (#6052) A StopAsyncIteration raised on assigning or unpacking will be now propagated instead of stopping the iteration.
* Add two missing error checks in hamt.c (GH-5851)Xiang Zhang2018-03-081-1/+7
|
* bpo-33005: Fix _PyGILState_Reinit() (#6001)Victor Stinner2018-03-061-4/+23
| | | | | | | | Fix a crash on fork when using a custom memory allocator (ex: using PYTHONMALLOC env var). _PyGILState_Reinit() and _PyInterpreterState_Enable() now use the default RAW memory allocator to allocate a new interpreters mutex on fork.
* Fix strncpy warning with gcc 8 (#5840)Siddhesh Poyarekar2018-03-061-2/+2
| | | | | The length in strncpy is one char too short and as a result it leads to a build warning with gcc 8. Comment out the strncpy since the interpreter aborts immediately after anyway.
* closes bpo-32980 Remove _PyFrame_Init (GH-5965)Thomas Nyberg2018-03-041-3/+0
|
* bpo-32836: Remove obsolete code from symtable pass (GH-5680)Nitish Chandra2018-02-261-25/+0
| | | | | | | When comprehensions switched to using a nested scope, the old code for generating a temporary name to hold the accumulation target became redundant, but was never actually removed. Patch by Nitish Chandra.
* bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter ↵Serhiy Storchaka2018-02-226-4053/+4132
| | | | | | | | | to compiler. (GH-5006) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-32838: Fix Python versions in the table of magic numbers. (#5658)Serhiy Storchaka2018-02-221-117/+117
|
* bpo-32604: Swap threads only if the interpreter is different. (gh-5778)Eric Snow2018-02-201-6/+14
| | | The CPython runtime assumes that there is a one-to-one relationship (for a given interpreter) between PyThreadState and OS threads. Sending and receiving on a channel in the same interpreter was causing crashes because of this (specifically due to a check in PyThreadState_Swap()). The solution is to not switch threads if the interpreter is the same.
* bpo-32869: Fix incorrect dst buffer size for MultiByteToWideChar (#5739)Alexey Izbyshev2018-02-181-1/+2
| | | | This function expects the destination buffer size to be given in wide characters, not bytes.
* bpo-32604: Clean up created subinterpreters before runtime finalization. ↵Eric Snow2018-02-171-1/+57
| | | | | | (gh-5709)
* Fix some warnings produced by different compilers. (#5593)Serhiy Storchaka2018-02-093-5/+5
|
* bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560)Alexey Izbyshev2018-02-061-3/+16
| | | | | | | Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process. This bug appears to have been introduced in 3.4 with the inheritable file descriptors support. This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions). `ioctl` is not a POSIX async-signal-safe approved function. ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
* bpo-10544: Disallow "yield" in comprehensions and generator expressions. ↵Serhiy Storchaka2018-02-041-24/+7
| | | | (GH-4564)
* bpo-32746: Fix multiple typos (GH-5144)Leo Arias2018-02-041-2/+2
| | | Fix typos found by codespell in docs, docstrings, and comments.
* bpo-32604: Fix memory leaks in the new _xxsubinterpreters module. (#5507)Eric Snow2018-02-031-0/+1
|
* bpo-32303 - Consistency fixes for namespace loaders (#5481)Barry Warsaw2018-02-022-1425/+1425
| | | | | | | * Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages. * Make sure ``__spec__.origin` matches ``__file__`` for namespace packages. https://bugs.python.org/issue32303 https://bugs.python.org/issue32305
* bpo-32747: Remove trailing spaces in docstrings. (GH-5491)oldk2018-02-021-3/+3
|
* bpo-32674: Improve the docstring for __import__ (GH-5339)oldk2018-02-021-3/+3
| | | | | Clarify that the level argument is used to determine whether to perform absolute or relative imports: 0 is absolute, while a positive number is the number of parent directories to search relative to the current module.
* bpo-32436: Fix compiler warning (#5483)Yury Selivanov2018-02-021-0/+2
|
* Fix typo in hamt.c comments (#5478)Dmitry Alimov2018-02-021-1/+1
|
* bpo-32711: Fix warnings for Python/ast_unparse.c (#5426)Stéphane Wirtel2018-02-011-3/+7
| | | * bpo-32711: Fix warnings for Python/ast_unparse.c
* bpo-32604: Expose the subinterpreters C-API in a "private" stdlib module. ↵Eric Snow2018-01-301-1/+274
| | | | | (gh-1748) The module is primarily intended for internal use in the test suite. Building the module under Windows will come in a follow-up PR.
* bpo-32550. Remove the STORE_ANNOTATION bytecode. (GH-5181)Mark Shannon2018-01-304-174/+123
|
* rename _imp initialization function to follow conventions (#5432)Benjamin Peterson2018-01-292-3/+2
| | | When the C imp module became _imp in 6f44d66bc491bad5b8d897a68da68e009e27829d, the initialization function should have been renamed from PyInit_imp to PyInit__imp.
* bpo-32707: Fix warnings in hamt.c (#5430)Yury Selivanov2018-01-291-3/+5
|
* bpo-20891: Py_Initialize() now creates the GIL (#4700)Victor Stinner2018-01-292-12/+17
| | | | The GIL is no longer created "on demand" to fix a race condition when PyGILState_Ensure() is called in a non-Python thread.
* bpo-32688: Make why the line is commented out clear (GH-5405)Xiang Zhang2018-01-291-1/+1
|
* bpo-32436: Use PyThreadState_GET() in all hot paths (GH-5363)Yury Selivanov2018-01-271-3/+6
|
* bpo-32436: Make PyContextVar_Get a little bit faster (#5350)Yury Selivanov2018-01-261-1/+2
| | | | Since context.c is compiled with Py_BUILD_CORE, using a macro will result in a slightly more optimal code.
* bpo-32670: Enforce PEP 479. (#5327)Yury Selivanov2018-01-261-1/+1
|
* bpo-32591: fix abort in _PyErr_WarnUnawaitedCoroutine during shutdown (#5337)Nathaniel J. Smith2018-01-261-0/+7
| | | | | | | | | | | | | | | | | | 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.
* String annotations [PEP 563] (#4390)Guido van Rossum2018-01-263-2/+1189
| | | | | | | | * Document `from __future__ import annotations` * Provide plumbing and tests for `from __future__ import annotations` * Implement unparsing the AST back to string form This is required for PEP 563 and as such only implements a part of the unparsing process that covers expressions.
* bpo-32436: Fix a refleak; var GC tracking; a GCC warning (#5326)Yury Selivanov2018-01-252-4/+6
| | | | | The refleak in question wasn't really important, as context vars are usually created at the toplevel and live as long as the interpreter lives, so the context var name isn't ever GCed anyways.
* Fix 3rd level node's binary representation in HAMT algorithm description (#5319)Dmitry Alimov2018-01-251-1/+1
|
* bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code ↵Serhiy Storchaka2018-01-255-1069/+1204
| | | | | (GH-5222) Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
* bpo-32436: Don't use native popcount() (also fixes bpo-32641) (#5292)Yury Selivanov2018-01-242-15/+13
|