summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* bpo-9566: Fix a warning in Python/getargs.c (#2890)Segev Finer2017-07-261-1/+1
|
* Fix a small typo in a comment (#2863)Stéphane Wirtel2017-07-251-1/+1
|
* bpo-30891: Fix again importlib _find_and_load() (#2665)Victor Stinner2017-07-211-351/+352
| | | | | | | | | 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.
* bpo-30876: Relative import from unloaded package now reimports the package ↵Serhiy Storchaka2017-07-122-380/+365
| | | | | | | | | (#2639) instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError.
* bpo-30891: Fix importlib _find_and_load() race condition (#2646)Victor Stinner2017-07-102-1539/+1526
| | | | | | * 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
* Remove _PyArg_NoStackKeywords(). (#2641)Serhiy Storchaka2017-07-101-18/+0
|
* bpo-30814: Fixed a race condition when import a submodule from a package. ↵Serhiy Storchaka2017-07-062-323/+306
| | | | (#2580)
* bpo-30854: Fix compile error when --without-threads (#2581)Masayuki Yamamoto2017-07-051-1/+1
| | | | | | * bpo-30854: Fix compile error when --without-threads * bpo-30854: fix news
* bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)Serhiy Storchaka2017-07-035-101/+27
| | | | | the bare METH_FASTCALL be used for functions with positional-only parameters.
* bpo-30832: Remove own implementation for thread-local storage (#2537)Masayuki Yamamoto2017-07-033-220/+8
| | | | | | | | | | | | | | | | * bpo-30832: Remove own implementation for thread-local storage CPython has provided the own implementation for thread-local storage (TLS) on Python/thread.c, it's used in the case which a platform has not supplied native TLS. However, currently all supported platforms (NT and pthreads) have provided native TLS and defined the Py_HAVE_NATIVE_TLS macro with unconditional in any case. * bpo-30832: replace NT with Windows * bpo-30832: change to directive chain * bpo-30832: remove comemnt which making no sense
* bpo-30647: Check nl_langinfo(CODESET) in locale coercion (GH-2374)Nick Coghlan2017-06-291-8/+11
| | | | | | | | | | | | | - On some versions of FreeBSD, setting the "UTF-8" locale succeeds, but a subsequent "nl_langinfo(CODESET)" fails - adding a check for this in the coercion logic means that coercion will happen on systems where this check succeeds, and will be skipped otherwise - that way CPython should automatically adapt to changes in platform behaviour, rather than needing a new release to enable coercion at build time - this also allows UTF-8 to be re-enabled as a coercion target, restoring the locale coercion behaviour on Mac OS X
* bpo-29585: Fix sysconfig.get_config_var("PYTHONFRAMEWORK") (GH-2483)INADA Naoki2017-06-291-1/+1
| | | | | | | | | | | `PYTHONFRAMEWORK` is defined in `Makefile` and it shoulnd't be used in `pyconfig.h`. `sysconfig.py --generate-posix-vars` reads config vars from Makefile and `pyconfig.h`. Conflicting variables should be avoided. Especially, string config variables in Makefile are unquoted, but in `pyconfig.h` are keep quoted. So it should be private (starts with underscore).
* bpo-30703: Improve signal delivery (#2415)Antoine Pitrou2017-06-281-21/+54
| | | | | | | | | | | | | | | | | | | | * 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
* bpo-29585: optimize site.py startup time (GH-136)INADA Naoki2017-06-281-0/+1
| | | | Avoid importing `sysconfig` from `site` by copying minimum code. Python startup is 5% faster on Linux and 30% faster on macOS
* [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302)Serhiy Storchaka2017-06-282-8/+19
| | | | | | | Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.
* bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to (#2403)Antoine Pitrou2017-06-261-45/+50
| | | | | | | | | | | * 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
* Trivial cleanup: remove redundant variable stores in ceval.c (#2012)Adrian Wielgosik2017-06-231-6/+1
| | | Redundant code leftover from cleanup in #16191: the variable `err` is being written to, even though it wasn't used after that point.
* bpo-30604: clean up co_extra support (#2144)Dino Viehland2017-06-212-5/+5
| | | bpo-30604: port fix from 3.6 dropping binary compatibility tweaks
* bpo-30183: Fixes HP-UX cc compilation error in pytime.c (#1351)haney2017-06-211-0/+20
| | | | | | | | | | | | | | | | * bpo-30183: Fixes HP-UX cc compilation error in pytime.c HP-UX does not support the CLOCK_MONOTONIC identifier, and will fail to compile: "Python/pytime.c", line 723: error #2020: identifier "CLOCK_MONOTONIC" is undefined const clockid_t clk_id = CLOCK_MONOTONIC; Add a new section for __hpux that calls 'gethrtime()' instead of 'clock_gettime()'. * bpo-30183: Removes unnecessary return
* bpo-30565: Add PYTHONCOERCECLOCALE=warn runtime flag (GH-2260)Nick Coghlan2017-06-181-25/+40
| | | | | | | | | | | | - removes PY_WARN_ON_C_LOCALE build time flag - locale coercion and compatibility warnings are now always compiled in, but are off by default - adds PYTHONCOERCECLOCALE=warn runtime option to aid in debugging potentially locale related compatibility problems Due to not-yet-resolved test failures on *BSD systems (including Mac OS X), this also temporarily disables UTF-8 as a locale coercion target, and skips testing the interpreter's behavior in the POSIX locale.
* bpo-30682: Removed a too-strict assertion that failed for certain f-strings. ↵ericvsmith2017-06-161-2/+2
| | | | | | (#2232) This caused a segfault on eval("f'\\\n'") and eval("f'\\\r'") in debug build.
* bpo-30626: Fix error handling in PyImport_Import(). (#2103)Serhiy Storchaka2017-06-151-2/+6
| | | | In rare circumstances PyImport_Import() could return NULL without raising an error.
* bpo-20627: Fix error message when keyword arguments are used (#2115)Sylvain2017-06-151-6/+6
|
* bpo-30501: Make the compiler producing optimized code for condition ↵Serhiy Storchaka2017-06-114-2448/+2533
| | | | expressions. (#1851)
* bpo-28180: Implementation for PEP 538 (#659)Nick Coghlan2017-06-111-7/+167
| | | | | | | | | | - new PYTHONCOERCECLOCALE config setting - coerces legacy C locale to C.UTF-8, C.utf8 or UTF-8 by default - always uses C.UTF-8 on Android - uses `surrogateescape` on stdin and stdout in the coercion target locales - configure option to disable locale coercion at build time - configure option to disable C locale warning at build time
* bpo-30600: Fix error messages (condition order in Argument Clinic) (#2051)Sylvain2017-06-103-63/+63
| | | | | | | | The function '_PyArg_ParseStack()' and '_PyArg_UnpackStack' were failing (with error "XXX() takes Y argument (Z given)") before the function '_PyArg_NoStackKeywords()' was called. Thus, the latter did not raise its more meaningful error : "XXX() takes no keyword arguments".
* Fix regression in error message introduced in bpo-29951. (#2028)Serhiy Storchaka2017-06-091-2/+2
| | | | | | | | * Fix regression in error message introduced in bpo-29951. * Add test. * Make the test more strong.
* bpo-30529: Fix errors for invalid whitespaces in f-string subexpressions. ↵Serhiy Storchaka2017-06-081-24/+7
| | | | | | | | (#1888) '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.
* bpo-30592: Fixed error messages for some builtins. (#1996)Serhiy Storchaka2017-06-081-3/+3
| | | | | Error messages when pass keyword arguments to some builtins that don't support keyword arguments contained double parenthesis: "()()". The regression was introduced by bpo-30534.
* bpo-30598: _PySys_EndInit() now duplicates warnoptions (#1998)Victor Stinner2017-06-081-4/+4
| | | | | | | | | | | | | Fix a reference in subinterpreters, like test_callbacks_leak() of test_atexit. warnoptions is a list used to pass options from the command line to the sys module constructor. Before this change, the list was shared by multiple interpreter which is not the expected behaviour. Each interpreter should have their own independent mutable world. This change duplicates the list in each interpreter. So each interpreter owns its own list, so each interpreter can clear its own list.
* bpo-30547: Fix multiple reference leaks (#1995)Stéphane Wirtel2017-06-081-1/+4
| | | | | | | | Fix regressions introduced by: - bpo-22257: commits 1abcf6700b4da6207fe859de40c6c1bada6b4fec and 6b4be195cd8868b76eb6fbe166acc39beee8ce36 Co-Authored-By: Victor Stinner <victor.stinner@gmail.com> Co-Authored-By: Louie Lu <git@louie.lu>
* bpo-30534: Fixed error messages when pass keyword arguments (#1901)Serhiy Storchaka2017-06-061-16/+32
| | | | | | | to functions implemented in C that don't support this. Also unified error messages for functions that don't take positional or keyword arguments.
* bpo-30567: Fix refleak in sys.getwindowsversion (#1940)Segev Finer2017-06-041-4/+4
|
* Add reference to help('FORMATTING') in format() builtin (GH-166)Amit Kumar2017-05-292-4/+8
|
* bpo-16500: Use register_at_fork() in the threading module (#1843)Antoine Pitrou2017-05-281-18/+0
| | | | | | * bpo-16500: Use register_at_fork() in the threading module * Update comment at top of _after_fork()
* Doc nits for bpo-16500 (#1841)Antoine Pitrou2017-05-284-7/+7
| | | | | | * Doc nits for bpo-16500 * Fix more references
* bpo-16500: Allow registering at-fork handlers (#1715)Antoine Pitrou2017-05-271-0/+10
| | | | | | | | | | | | * bpo-16500: Allow registering at-fork handlers * Address Serhiy's comments * Add doc for new C API * Add doc for new Python-facing function * Add NEWS entry + doc nit
* Drop a duplicate line. (#1809)Eric Snow2017-05-251-2/+1
|
* Delete sigcheck.c since it appears unused (#1723)Segev Finer2017-05-251-19/+0
|
* bpo-29104: Fixed parsing backslashes in f-strings. (#490)Serhiy Storchaka2017-05-251-21/+32
|
* bpo-22257: Private C-API for main interpreter initialization (PEP 432). (#1729)Eric Snow2017-05-242-15/+75
| | | (patch by Nick Coghlan)
* bpo-22257: Private C-API for core runtime initialization (PEP 432). (#1772)Eric Snow2017-05-242-45/+185
| | | (patch by Nick Coghlan)
* Improves test_underpth_nosite_file to reveal why it fails. (#1763)Steve Dower2017-05-231-1/+6
| | | | | | | | | | | | | | * Improves test_underpth_nosite_file to reveal why it fails. * Enable building with Windows 10 SDK. * Fix WinSDK detection * Fix initialization on Windows when a ._pth file exists. * Fix tabs * Adds comment about Py_GetPath call.
* Update importlib.h (GH-1762)Zachary Ware2017-05-231-2/+2
|
* bpo-22257: Small changes for PEP 432. (#1728)Eric Snow2017-05-235-1850/+1960
| | | PEP 432 specifies a number of large changes to interpreter startup code, including exposing a cleaner C-API. The major changes depend on a number of smaller changes. This patch includes all those smaller changes.
* bpo-29102: Add a unique ID to PyInterpreterState. (#1639)Eric Snow2017-05-232-0/+38
|
* bpo-30395 _PyGILState_Reinit deadlock fix (#1734)Jason Fried2017-05-221-0/+4
| | | | head_lock could be held by another thread when fork happened. We should reset it to avoid deadlock.
* bpo-30039: Don't run signal handlers while resuming a yield from stack (#1081)Nathaniel J. Smith2017-05-171-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* bpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480)Xiang Zhang2017-05-101-1/+1
|
* bpo-30024: Circular imports involving absolute imports with binding (#1264)Serhiy Storchaka2017-05-091-2/+2
| | | a submodule to a name are now supported.