]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agobpo-39465: Don't access directly _Py_Identifier members (GH-20043)
Victor Stinner [Mon, 11 May 2020 23:43:38 +0000 (01:43 +0200)] 
bpo-39465: Don't access directly _Py_Identifier members (GH-20043)

* Replace id->object with _PyUnicode_FromId(&id)
* Use _Py_static_string_init(str) macro to initialize statically
  name_op in typeobject.c.

5 years agobpo-40334: produce specialized errors for invalid del targets (GH-19911)
Shantanu [Mon, 11 May 2020 21:53:58 +0000 (14:53 -0700)] 
bpo-40334: produce specialized errors for invalid del targets (GH-19911)

5 years agobpo-40584: Update PyType_FromModuleAndSpec() to process tp_vectorcall_offset (GH...
Hai Shi [Mon, 11 May 2020 21:38:55 +0000 (05:38 +0800)] 
bpo-40584: Update PyType_FromModuleAndSpec() to process tp_vectorcall_offset (GH-20026)

5 years agobpo-40561: Add docstrings for webbrowser open functions (GH-19999)
Brad Solomon [Mon, 11 May 2020 18:50:11 +0000 (14:50 -0400)] 
bpo-40561: Add docstrings for webbrowser open functions (GH-19999)

Co-authored-by: Brad Solomon <brsolomon@deloitte.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agobpo-36346: array: Don't use deprecated APIs (GH-19653)
Inada Naoki [Mon, 11 May 2020 06:37:25 +0000 (15:37 +0900)] 
bpo-36346: array: Don't use deprecated APIs (GH-19653)

* Py_UNICODE -> wchar_t
* Py_UNICODE -> unicode in Argument Clinic
* PyUnicode_AsUnicode -> PyUnicode_AsWideCharString
* Don't use "u#" format.

Co-authored-by: Victor Stinner <vstinner@python.org>
5 years agobpo-40575: Avoid unnecessary overhead in _PyDict_GetItemIdWithError() (GH-20018)
scoder [Mon, 11 May 2020 04:04:31 +0000 (06:04 +0200)] 
bpo-40575: Avoid unnecessary overhead in _PyDict_GetItemIdWithError() (GH-20018)

Avoid unnecessary overhead in _PyDict_GetItemIdWithError() by calling
_PyDict_GetItem_KnownHash() instead of the more generic PyDict_GetItemWithError(),
since we already know the hash of interned strings.

5 years agobpo-40585: Normalize errors messages in codeop when comparing them (GH-20030)
Pablo Galindo [Mon, 11 May 2020 00:41:26 +0000 (01:41 +0100)] 
bpo-40585: Normalize errors messages in codeop when comparing them (GH-20030)

With the new parser, the error message contains always the trailing
newlines, causing the comparison of the repr of the error messages
in codeop to fail. This commit makes the new parser mirror the old parser's
behaviour regarding trailing newlines.

5 years agoImprove code clarity for the set lookup logic (GH-20028)
Raymond Hettinger [Sun, 10 May 2020 21:53:29 +0000 (14:53 -0700)] 
Improve code clarity for the set lookup logic (GH-20028)

5 years agobpo-40257: Tweak docstrings for special generic aliases. (GH-20022)
Serhiy Storchaka [Sun, 10 May 2020 12:14:27 +0000 (15:14 +0300)] 
bpo-40257: Tweak docstrings for special generic aliases. (GH-20022)

* Add the terminating period.
* Omit module name for builtin types.

5 years agobpo-40397: Fix subscription of nested generic alias without parameters. (GH-20021)
Serhiy Storchaka [Sun, 10 May 2020 10:39:40 +0000 (13:39 +0300)] 
bpo-40397: Fix subscription of nested generic alias without parameters. (GH-20021)

5 years agobpo-37986: Improve perfomance of PyLong_FromDouble() (GH-15611)
Sergey Fedoseev [Sun, 10 May 2020 09:15:57 +0000 (14:15 +0500)] 
bpo-37986: Improve perfomance of PyLong_FromDouble() (GH-15611)

* bpo-37986: Improve perfomance of PyLong_FromDouble()

* Use strict bound check for safety and symmetry

* Remove possibly outdated performance claims

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
5 years agobpo-40549: Convert posixmodule.c to multiphase init (GH-19982)
Victor Stinner [Sun, 10 May 2020 09:05:29 +0000 (11:05 +0200)] 
bpo-40549: Convert posixmodule.c to multiphase init (GH-19982)

Convert posixmodule.c ("posix" or "nt" module) to the multiphase
initialization (PEP 489).

* Create the module using PyModuleDef_Init().
* Create ScandirIteratorType and DirEntryType with the new
  PyType_FromModuleAndSpec() (PEP 573)
* Get the module state from ScandirIteratorType and DirEntryType with
  the new PyType_GetModule() (PEP 573)
* Pass module to functions which access the module state.
* convert_sched_param() gets a new module parameter. It is now called
  directly since Argument Clinic doesn't support passing the module
  to an argument converter callback.
* Remove _posixstate_global macro.

5 years agobpo-40397: Remove __args__ and __parameters__ from _SpecialGenericAlias (GH-19984)
Serhiy Storchaka [Sun, 10 May 2020 08:53:16 +0000 (11:53 +0300)] 
bpo-40397: Remove __args__ and __parameters__ from _SpecialGenericAlias (GH-19984)

5 years agoAdd link to Enum class (GH-19884)
Andre Delfino [Sun, 10 May 2020 05:15:54 +0000 (02:15 -0300)] 
Add link to Enum class (GH-19884)

5 years agobpo-40334: Avoid collisions between parser variables and grammar variables (GH-19987)
Pablo Galindo [Sun, 10 May 2020 04:34:50 +0000 (05:34 +0100)] 
bpo-40334: Avoid collisions between parser variables and grammar variables (GH-19987)

This is for the C generator:
- Disallow rule and variable names starting with `_`
- Rename most local variable names generated by the parser to start with `_`

Exceptions:
- Renaming `p` to `_p` will be a separate PR
- There are still some names that might clash, e.g.
  - anything starting with `Py`
  - C reserved words (`if` etc.)
  - Macros like `EXTRA` and `CHECK`

5 years agobpo-40570: Improve compatibility of uname_result with late-bound .platform (#20015)
Jason R. Coombs [Sat, 9 May 2020 14:12:41 +0000 (10:12 -0400)] 
bpo-40570: Improve compatibility of uname_result with late-bound .platform (#20015)

* bpo-40570: Improve compatibility of uname_result with late-bound .platform.

* Add test capturing ability to cast uname to a tuple.

5 years agobpo-40566: Apply PEP 573 to abc module (GH-20005)
Dong-hee Na [Sat, 9 May 2020 08:31:40 +0000 (17:31 +0900)] 
bpo-40566: Apply PEP 573 to abc module (GH-20005)

5 years agobpo-39791: Add files() to importlib.resources (GH-19722)
Jason R. Coombs [Fri, 8 May 2020 23:20:26 +0000 (19:20 -0400)] 
bpo-39791: Add files() to importlib.resources (GH-19722)

* bpo-39791: Update importlib.resources to support files() API (importlib_resources 1.5).

* 📜🤖 Added by blurb_it.

* Add some documentation about the new objects added.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
5 years agobpo-40502: Initialize n->n_col_offset (GH-19988)
Joannah Nanjekye [Fri, 8 May 2020 20:58:28 +0000 (17:58 -0300)] 
bpo-40502: Initialize n->n_col_offset (GH-19988)

* initialize n->n_col_offset

* 📜🤖 Added by blurb_it.

* Move initialization

Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
5 years agobpo-40541: Add optional *counts* parameter to random.sample() (GH-19970)
Raymond Hettinger [Fri, 8 May 2020 14:53:15 +0000 (07:53 -0700)] 
bpo-40541: Add optional *counts* parameter to random.sample() (GH-19970)

5 years agoMake the first dataclass example more useful (GH-19994)
Ned Batchelder [Fri, 8 May 2020 11:39:57 +0000 (07:39 -0400)] 
Make the first dataclass example more useful (GH-19994)

5 years agobpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)
Chris Jerdonek [Fri, 8 May 2020 10:54:38 +0000 (03:54 -0700)] 
bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)

This fixes a possible memory leak in the C implementation of
asyncio.Task.

5 years agobpo-40273: Reversible mappingproxy (FH-19513)
Zackery Spytz [Fri, 8 May 2020 05:25:50 +0000 (23:25 -0600)] 
bpo-40273: Reversible mappingproxy (FH-19513)

5 years agobpo-40555: Check for p->error_indicator in loop rules after the main loop is done...
Pablo Galindo [Fri, 8 May 2020 02:38:44 +0000 (03:38 +0100)] 
bpo-40555: Check for p->error_indicator in loop rules after the main loop is done (GH-19986)

5 years agobpo-40517: Implement syntax highlighting support for ASDL (GH-19967)
Batuhan Taskaya [Thu, 7 May 2020 20:57:26 +0000 (23:57 +0300)] 
bpo-40517: Implement syntax highlighting support for ASDL (GH-19967)

5 years agobpo-40548: Always run GitHub action, even on doc PRs (GH-19981)
Victor Stinner [Thu, 7 May 2020 20:42:14 +0000 (22:42 +0200)] 
bpo-40548: Always run GitHub action, even on doc PRs (GH-19981)

Always run GitHub action jobs, even on documentation-only pull
requests. So it will be possible to make a GitHub action job, like
the Windows (64-bit) job, mandatory.

5 years agobpo-38787: Update structures.rst docs (PEP 573) (GH-19980)
Hai Shi [Thu, 7 May 2020 17:16:01 +0000 (01:16 +0800)] 
bpo-38787: Update structures.rst docs (PEP 573) (GH-19980)

5 years agobpo-32604: [_xxsubinterpreters] Propagate exceptions. (GH-19768)
Eric Snow [Thu, 7 May 2020 14:56:01 +0000 (08:56 -0600)] 
bpo-32604: [_xxsubinterpreters] Propagate exceptions. (GH-19768)

(Note: PEP 554 is not accepted and the implementation in the code base is a private one for use in the test suite.)

If code running in a subinterpreter raises an uncaught exception then the "run" call in the calling interpreter fails. A RunFailedError is raised there that summarizes the original exception as a string. The actual exception type, __cause__, __context__, state, etc. are all discarded. This turned out to be functionally insufficient in practice. There is a more helpful solution (and PEP 554 has been updated appropriately).

This change adds the exception propagation behavior described in PEP 554 to the _xxsubinterpreters module. With this change a copy of the original exception is set to __cause__ on the RunFailedError. For now we are using "pickle", which preserves the exception's state. We also preserve the original __cause__, __context__, and __traceback__ (since "pickle" does not preserve those).

https://bugs.python.org/issue32604

5 years agobpo-40545: Export _PyErr_GetTopmostException() function (GH-19978)
Victor Stinner [Thu, 7 May 2020 13:42:33 +0000 (15:42 +0200)] 
bpo-40545: Export _PyErr_GetTopmostException() function (GH-19978)

Declare _PyErr_GetTopmostException() with PyAPI_FUNC() to properly
export the function in the C API. The function remains private
("_Py") prefix.

Co-Authored-By: Julien Danjou <julien@danjou.info>
5 years agobpo-38787: C API for module state access from extension methods (PEP 573) (GH-19936)
Petr Viktorin [Thu, 7 May 2020 13:39:59 +0000 (15:39 +0200)] 
bpo-38787: C API for module state access from extension methods (PEP 573) (GH-19936)

Module C state is now accessible from C-defined heap type methods (PEP 573).
Patch by Marcel Plch and Petr Viktorin.

Co-authored-by: Marcel Plch <mplch@redhat.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
5 years agobpo-40334: Error message for invalid default args in function call (GH-19973)
Lysandros Nikolaou [Thu, 7 May 2020 10:44:06 +0000 (13:44 +0300)] 
bpo-40334: Error message for invalid default args in function call (GH-19973)

When parsing something like `f(g()=2)`, where the name of a default arg
is not a NAME, but an arbitrary expression, a specialised error message
is emitted.

5 years agobpo-40334: Fix error location upon parsing an invalid string literal (GH-19962)
Lysandros Nikolaou [Thu, 7 May 2020 10:37:51 +0000 (13:37 +0300)] 
bpo-40334: Fix error location upon parsing an invalid string literal (GH-19962)

When parsing a string with an invalid escape, the old parser used to
point to the beginning of the invalid string. This commit changes the new
parser to match that behaviour, since it's currently pointing to the
end of the string (or to be more precise, to the beginning of the next
token).

5 years agobpo-1635741: Port errno module to multiphase initialization (GH-19923)
Dong-hee Na [Thu, 7 May 2020 01:17:16 +0000 (10:17 +0900)] 
bpo-1635741: Port errno module to multiphase initialization (GH-19923)

5 years agobpo-40397: Refactor typing._GenericAlias (GH-19719)
Serhiy Storchaka [Thu, 7 May 2020 01:09:33 +0000 (04:09 +0300)] 
bpo-40397: Refactor typing._GenericAlias (GH-19719)

Make the design more object-oriented.
Split _GenericAlias on two almost independent classes: for special
generic aliases like List and for parametrized generic aliases like List[int].
Add specialized subclasses for Callable, Callable[...], Tuple and Union[...].

5 years agobpo-40334: Generate comments in the parser code to improve debugging (GH-19966)
Pablo Galindo [Wed, 6 May 2020 22:14:43 +0000 (23:14 +0100)] 
bpo-40334: Generate comments in the parser code to improve debugging (GH-19966)

5 years agobpo-40334: Allow trailing comma in parenthesised context managers (GH-19964)
Pablo Galindo [Wed, 6 May 2020 21:54:34 +0000 (22:54 +0100)] 
bpo-40334: Allow trailing comma in parenthesised context managers (GH-19964)

5 years agoFix typo in sqlite3 documentation (GH-19965)
Naglis [Wed, 6 May 2020 19:51:43 +0000 (19:51 +0000)] 
Fix typo in sqlite3 documentation (GH-19965)

*first* is repeated twice.

5 years agobpo-40334: Add type to the assignment rule in the grammar file (GH-19963)
Lysandros Nikolaou [Wed, 6 May 2020 18:11:04 +0000 (21:11 +0300)] 
bpo-40334: Add type to the assignment rule in the grammar file (GH-19963)

5 years agobpo-40521: Disable list free list in subinterpreters (GH-19959)
Victor Stinner [Wed, 6 May 2020 17:05:27 +0000 (19:05 +0200)] 
bpo-40521: Disable list free list in subinterpreters (GH-19959)

When Python is built with experimental isolated interpreters, disable
the list free list.

Temporary workaround until this cache is made per-interpreter.

5 years agobpo-40533: Disable GC in subinterpreters (GH-19961)
Victor Stinner [Wed, 6 May 2020 16:25:06 +0000 (18:25 +0200)] 
bpo-40533: Disable GC in subinterpreters (GH-19961)

When Python is built with experimental isolated interpreters, a
garbage collection now does nothing in an isolated interpreter.

Temporary workaround until subinterpreters stop sharing Python
objects.

5 years agobpo-40521: Disable method cache in subinterpreters (GH-19960)
Victor Stinner [Wed, 6 May 2020 16:23:58 +0000 (18:23 +0200)] 
bpo-40521: Disable method cache in subinterpreters (GH-19960)

When Python is built with experimental isolated interpreters, disable
the type method cache.

Temporary workaround until the cache is made per-interpreter.

5 years agobpo-40528: Improve and clear several aspects of the ASDL definition code for the...
Batuhan Taskaya [Wed, 6 May 2020 14:29:32 +0000 (17:29 +0300)] 
bpo-40528: Improve and clear several aspects of the ASDL definition code for the AST (GH-19952)

5 years agobpo-40527: Fix command line argument parsing (GH-19955)
Victor Stinner [Wed, 6 May 2020 13:22:17 +0000 (15:22 +0200)] 
bpo-40527: Fix command line argument parsing (GH-19955)

5 years agoRevert "bpo-40517: Implement syntax highlighting support for ASDL (#19928)" (#19950)
Raymond Hettinger [Wed, 6 May 2020 05:33:55 +0000 (22:33 -0700)] 
Revert "bpo-40517: Implement syntax highlighting support for ASDL (#19928)" (#19950)

This reverts commit d60040ba226bd2e3b6f58d074015aa2499dc1cb8.

5 years agobpo-40517: Implement syntax highlighting support for ASDL (#19928)
Batuhan Taskaya [Wed, 6 May 2020 05:24:39 +0000 (08:24 +0300)] 
bpo-40517: Implement syntax highlighting support for ASDL (#19928)

5 years agobpo-40480 "fnmatch" exponential execution time (GH-19908)
Tim Peters [Wed, 6 May 2020 02:28:24 +0000 (21:28 -0500)] 
bpo-40480 "fnmatch" exponential execution time (GH-19908)

bpo-40480:  create different regexps in the presence of multiple `*`
patterns to prevent fnmatch() from taking exponential time.

5 years agobpo-40523: Add pass-throughs for hash() and reversed() to weakref.proxy objects ...
Pablo Galindo [Tue, 5 May 2020 21:58:19 +0000 (22:58 +0100)] 
bpo-40523: Add pass-throughs for hash() and reversed() to weakref.proxy objects (GH-19946)

5 years agobpo-40504: Allow weakrefs to lru_cache objects (GH-19938)
Dennis Sweeney [Tue, 5 May 2020 21:14:32 +0000 (17:14 -0400)] 
bpo-40504: Allow weakrefs to lru_cache objects (GH-19938)

5 years agobpo-40355: Improve error messages in ast.literal_eval with malformed Dict nodes ...
Curtis Bucher [Tue, 5 May 2020 19:40:56 +0000 (12:40 -0700)] 
bpo-40355: Improve error messages in ast.literal_eval with malformed Dict nodes (GH-19868)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agobpo-40513: _xxsubinterpreters.run_string() releases the GIL (GH-19944)
Victor Stinner [Tue, 5 May 2020 18:33:06 +0000 (20:33 +0200)] 
bpo-40513: _xxsubinterpreters.run_string() releases the GIL (GH-19944)

In the experimental isolated subinterpreters build mode,
_xxsubinterpreters.run_string() now releases the GIL.

5 years agobpo-40513: Per-interpreter GIL (GH-19943)
Victor Stinner [Tue, 5 May 2020 18:27:47 +0000 (20:27 +0200)] 
bpo-40513: Per-interpreter GIL (GH-19943)

In the experimental isolated subinterpreters build mode, the GIL is
now per-interpreter.

Move gil from _PyRuntimeState.ceval to PyInterpreterState.ceval.

new_interpreter() always get the config from the main interpreter.

5 years agobpo-40513: new_interpreter() init GIL earlier (GH-19942)
Victor Stinner [Tue, 5 May 2020 18:16:37 +0000 (20:16 +0200)] 
bpo-40513: new_interpreter() init GIL earlier (GH-19942)

Fix also code to handle init_interp_main() failure.

5 years agobpo-40522: _PyThreadState_Swap() sets autoTSSkey (GH-19939)
Victor Stinner [Tue, 5 May 2020 17:56:48 +0000 (19:56 +0200)] 
bpo-40522: _PyThreadState_Swap() sets autoTSSkey (GH-19939)

In the experimental isolated subinterpreters build mode,
_PyThreadState_GET() gets the autoTSSkey variable and
_PyThreadState_Swap() sets the autoTSSkey variable.

* Add _PyThreadState_GetTSS()
* _PyRuntimeState_GetThreadState() and _PyThreadState_GET()
  return _PyThreadState_GetTSS()
* PyEval_SaveThread() sets the autoTSSkey variable to current Python
  thread state rather than NULL.
* eval_frame_handle_pending() doesn't check that
  _PyThreadState_Swap() result is NULL.
* _PyThreadState_Swap() gets the current Python thread state with
  _PyThreadState_GetTSS() rather than
  _PyRuntimeGILState_GetThreadState().
* PyGILState_Ensure() no longer checks _PyEval_ThreadsInitialized()
  since it cannot access the current interpreter.

5 years agobpo-40521: Disable free lists in subinterpreters (GH-19937)
Victor Stinner [Tue, 5 May 2020 17:55:29 +0000 (19:55 +0200)] 
bpo-40521: Disable free lists in subinterpreters (GH-19937)

When Python is built with experimental isolated interpreters, disable
tuple, dict and free free lists.

Temporary workaround until these caches are made per-interpreter.

Add frame_alloc() and frame_get_builtins() subfunctions to simplify
_PyFrame_New_NoTrack().

5 years agobpo-40458: Increase reserved stack space to prevent overflow crash on Windows (GH...
Steve Dower [Tue, 5 May 2020 17:45:35 +0000 (18:45 +0100)] 
bpo-40458: Increase reserved stack space to prevent overflow crash on Windows (GH-19845)

5 years agobpo-40521: Disable Unicode caches in isolated subinterpreters (GH-19933)
Victor Stinner [Tue, 5 May 2020 16:50:30 +0000 (18:50 +0200)] 
bpo-40521: Disable Unicode caches in isolated subinterpreters (GH-19933)

When Python is built in the experimental isolated subinterpreters
mode, disable Unicode singletons and Unicode interned strings since
they are shared by all interpreters.

Temporary workaround until these caches are made per-interpreter.

5 years agoRevert "bpo-40513: Per-interpreter signals pending (GH-19924)" (GH-19932)
Victor Stinner [Tue, 5 May 2020 15:40:18 +0000 (17:40 +0200)] 
Revert "bpo-40513: Per-interpreter signals pending (GH-19924)" (GH-19932)

This reverts commit 4e01946cafca0cf49f796c3118e0d65237bcad69.

5 years agobpo-40520: Remove redundant comment in pydebug.h (GH-19931)
Hai Shi [Tue, 5 May 2020 15:20:38 +0000 (10:20 -0500)] 
bpo-40520: Remove redundant comment in pydebug.h (GH-19931)

Automerge-Triggered-By: @corona10
5 years agobpo-29587: _PyErr_ChainExceptions() checks exception (GH-19902)
Victor Stinner [Tue, 5 May 2020 15:07:41 +0000 (17:07 +0200)] 
bpo-29587: _PyErr_ChainExceptions() checks exception (GH-19902)

_PyErr_ChainExceptions() now ensures that the first parameter is an
exception type, as done by _PyErr_SetObject().

* The following function now check PyExceptionInstance_Check() in an
  assertion using a new _PyBaseExceptionObject_cast() helper
  function:

  * PyException_GetTraceback(), PyException_SetTraceback()
  * PyException_GetCause(), PyException_SetCause()
  * PyException_GetContext(), PyException_SetContext()

* PyExceptionClass_Name() now checks PyExceptionClass_Check() with an
  assertion.

* Remove XXX comment and add gi_exc_state variable to _gen_throw().

* Remove comment from test_generators

5 years agobpo-40513: Per-interpreter recursion_limit (GH-19929)
Victor Stinner [Tue, 5 May 2020 14:52:52 +0000 (16:52 +0200)] 
bpo-40513: Per-interpreter recursion_limit (GH-19929)

Move recursion_limit member from _PyRuntimeState.ceval to
PyInterpreterState.ceval.

* Py_SetRecursionLimit() now only sets _Py_CheckRecursionLimit
  of ceval.c if the current Python thread is part of the main
  interpreter.
* Inline _Py_MakeEndRecCheck() into _Py_LeaveRecursiveCall().
* Convert _Py_RecursionLimitLowerWaterMark() macro into a static
  inline function.

5 years agobpo-32117: Updated Simpsons names in docs (GH-19737)
Javier Buzzi [Tue, 5 May 2020 14:49:57 +0000 (10:49 -0400)] 
bpo-32117: Updated Simpsons names in docs (GH-19737)

`sally` is not a Simpsons character

Automerge-Triggered-By: @gvanrossum
5 years agobpo-40514: Add --with-experimental-isolated-subinterpreters (GH-19926)
Victor Stinner [Tue, 5 May 2020 14:41:11 +0000 (16:41 +0200)] 
bpo-40514: Add --with-experimental-isolated-subinterpreters (GH-19926)

Add --with-experimental-isolated-subinterpreters build option to
configure: better isolate subinterpreters, experimental build mode.

When used, force the usage of the libc malloc() memory allocator,
since pymalloc relies on the unique global interpreter lock (GIL).

5 years agobpo-40513: Per-interpreter gil_drop_request (GH-19927)
Victor Stinner [Tue, 5 May 2020 14:14:31 +0000 (16:14 +0200)] 
bpo-40513: Per-interpreter gil_drop_request (GH-19927)

Move gil_drop_request member from _PyRuntimeState.ceval to
PyInterpreterState.ceval.

5 years agobpo-40513: Per-interpreter signals pending (GH-19924)
Victor Stinner [Tue, 5 May 2020 13:43:37 +0000 (15:43 +0200)] 
bpo-40513: Per-interpreter signals pending (GH-19924)

Move signals_pending from _PyRuntime.ceval to
PyInterpreterState.ceval.

5 years agobpo-40286: Put methods in correct sections. Add security notice to use secrets for...
Raymond Hettinger [Tue, 5 May 2020 05:52:13 +0000 (22:52 -0700)] 
bpo-40286: Put methods in correct sections. Add security notice to use secrets for session tokens. (GH-19870)

5 years agobpo-40459: Fix NameError in platform.py (GH-19855)
Dennis Sweeney [Tue, 5 May 2020 02:33:17 +0000 (22:33 -0400)] 
bpo-40459: Fix NameError in platform.py (GH-19855)

5 years agobpo-1635741: Port syslog module to multiphase initialization (GH-19907)
Dong-hee Na [Tue, 5 May 2020 01:49:46 +0000 (10:49 +0900)] 
bpo-1635741: Port syslog module to multiphase initialization (GH-19907)

5 years agobpo-40499: Mention that asyncio.wait() needs a non-empty aws set (GH-19900)
Joel Rosdahl [Mon, 4 May 2020 21:56:00 +0000 (23:56 +0200)] 
bpo-40499: Mention that asyncio.wait() needs a non-empty aws set (GH-19900)

A similar formulation was added in bpo-21596
(db74d982d43d98040e38665d843cbc8de4a082b1) but was lost in bpo-33649
(3faaa8857a42a36383bb18425444e597fc876797).

5 years agobpo-39470: Indicate that ``os.makedirs`` is equivalent to ``Path.mkdir`` (GH-18216)
Joannah Nanjekye [Mon, 4 May 2020 19:47:03 +0000 (16:47 -0300)] 
bpo-39470: Indicate that ``os.makedirs`` is equivalent to ``Path.mkdir`` (GH-18216)

* Indicate os.makedirs is equivalent to Path.mkdir

* 📜🤖 Added by blurb_it.

* ignore news feed

Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
5 years agobpo-40360: Add a What's New entry for lib2to3 pending deprecation (GH-19898)
Miro Hrončok [Mon, 4 May 2020 19:02:00 +0000 (21:02 +0200)] 
bpo-40360: Add a What's New entry for lib2to3 pending deprecation (GH-19898)

5 years agobpo-40275: test.support imports lazily locale import (GH-19761)
Hai Shi [Mon, 4 May 2020 18:05:02 +0000 (02:05 +0800)] 
bpo-40275: test.support imports lazily locale import (GH-19761)

5 years agobpo-40489: Add test case for dict contain use after free (GH-19906)
Dong-hee Na [Mon, 4 May 2020 17:30:42 +0000 (02:30 +0900)] 
bpo-40489: Add test case for dict contain use after free (GH-19906)

5 years agobpo-40135: Fix multiprocessing test_shared_memory_across_processes() (GH-19892)
Hai Shi [Mon, 4 May 2020 15:05:54 +0000 (23:05 +0800)] 
bpo-40135: Fix multiprocessing test_shared_memory_across_processes() (GH-19892)

Don't define shared memory block's name in test_shared_memory_across_processes():
use SharedMemory(create=True) instead.

5 years agobpo-40455: Remove gcc10 warning about x_digits (#19852)
Dong-hee Na [Mon, 4 May 2020 13:32:42 +0000 (22:32 +0900)] 
bpo-40455: Remove gcc10 warning about x_digits (#19852)

* bpo-40455: Remove gcc10 warning about x_digits

* bpo-40455: nit

* bpo-40455: fix logic error

5 years agobpo-39573: Use Py_IS_TYPE to check for types (GH-19882)
Hai Shi [Mon, 4 May 2020 13:31:38 +0000 (21:31 +0800)] 
bpo-39573: Use Py_IS_TYPE to check for types (GH-19882)

5 years agobpo-40246: Revert reporting of invalid string prefixes (GH-19888)
Lysandros Nikolaou [Mon, 4 May 2020 11:32:18 +0000 (14:32 +0300)] 
bpo-40246: Revert reporting of invalid string prefixes (GH-19888)

Due to backwards compatibility concerns regarding keywords immediately followed by a string without whitespace between them (like in `bg="#d00" if clear else"#fca"`) will fail to parse,
commit 41d5b94af44e34ac05d4cd57460ed104ccf96628 has to be reverted.

5 years agobpo-40334: Spacialized error message for invalid args after bare '*' (GH-19865)
Lysandros Nikolaou [Mon, 4 May 2020 10:58:31 +0000 (13:58 +0300)] 
bpo-40334: Spacialized error message for invalid args after bare '*' (GH-19865)

When parsing things like `def f(*): pass` the old parser used to output `SyntaxError: named arguments must follow bare *`, which the new parser wasn't able to do.

5 years agobpo-40491: Fix typo in syntax error for numeric literals (GH-19893)
Shantanu [Mon, 4 May 2020 08:13:30 +0000 (01:13 -0700)] 
bpo-40491: Fix typo in syntax error for numeric literals (GH-19893)

5 years agobpo-40408: Fix support of nested type variables in GenericAlias. (GH-19836)
Serhiy Storchaka [Mon, 4 May 2020 07:56:05 +0000 (10:56 +0300)] 
bpo-40408: Fix support of nested type variables in GenericAlias. (GH-19836)

5 years agobpo-40493: fix function type comment parsing (GH-19894)
Shantanu [Mon, 4 May 2020 05:08:14 +0000 (22:08 -0700)] 
bpo-40493: fix function type comment parsing (GH-19894)

The grammar for func_type_input rejected things like `(*t1) ->t2`. This fixes that.

Automerge-Triggered-By: @gvanrossum
5 years agoClean up unused imports for the peg generator module (GH-19891)
Anthony Shaw [Mon, 4 May 2020 02:03:05 +0000 (12:03 +1000)] 
Clean up unused imports for the peg generator module (GH-19891)

5 years agobpo-40334: Set error_indicator in _PyPegen_raise_error (GH-19887)
Lysandros Nikolaou [Mon, 4 May 2020 00:20:09 +0000 (03:20 +0300)] 
bpo-40334: Set error_indicator in _PyPegen_raise_error (GH-19887)

Due to PyErr_Occurred not being called at the beginning of each rule, we need to set the error indicator, so that rules do not get expanded after an exception has been thrown

5 years agoRemove outdated and confusing advice about setting maxsize (GH-19889)
Raymond Hettinger [Sun, 3 May 2020 23:45:13 +0000 (16:45 -0700)] 
Remove outdated and confusing advice about setting maxsize (GH-19889)

5 years agoRemove out-of-date comment (GH-19886)
Raymond Hettinger [Sun, 3 May 2020 18:25:46 +0000 (11:25 -0700)] 
Remove out-of-date comment (GH-19886)

5 years agobpo-38870: Don't start generated output with newlines in ast.unparse (GH-19636)
Batuhan Taskaya [Sun, 3 May 2020 17:11:51 +0000 (20:11 +0300)] 
bpo-38870: Don't start generated output with newlines in ast.unparse (GH-19636)

5 years agoSimplify set entry insertion logic. (GH-19881)
Raymond Hettinger [Sun, 3 May 2020 11:51:05 +0000 (04:51 -0700)] 
Simplify set entry insertion logic. (GH-19881)

5 years agobpo-29587: allow chaining NULL exceptions in _gen_throw() (GH-19877)
Chris Jerdonek [Sun, 3 May 2020 07:07:57 +0000 (00:07 -0700)] 
bpo-29587: allow chaining NULL exceptions in _gen_throw() (GH-19877)

This is a follow-up to GH-19823 that removes the check that the
exception value isn't NULL, prior to calling _PyErr_ChainExceptions().
This enables implicit exception chaining for gen.throw() in more
circumstances.

The commit also adds a test that a particular code snippet involving
gen.throw() doesn't crash.  The test shows why the new
`gi_exc_state.exc_type != Py_None` check that was added is necessary.
Without the new check, the code snippet (as well as a number of other
tests) crashes on certain platforms (e.g. Fedora but not Mac).

5 years agoMinor code cleanups for statistics (GH-19873)
Raymond Hettinger [Sun, 3 May 2020 02:30:24 +0000 (19:30 -0700)] 
Minor code cleanups for statistics (GH-19873)

* Minor cleanups:  Removed unused code.  Move C import near its Python version.

* Clean-up whitespace

5 years agoFix missing space in docs(GH-19866)
Mathieu Dupuy [Sat, 2 May 2020 23:50:47 +0000 (23:50 +0000)] 
Fix missing space in docs(GH-19866)

5 years agobpo-40465: Deprecate the optional argument to random.shuffle(). (#19867)
Raymond Hettinger [Sat, 2 May 2020 23:45:32 +0000 (16:45 -0700)] 
bpo-40465: Deprecate the optional argument to random.shuffle(). (#19867)

5 years agobpo-40419: timeit CLI docs now mention 1,2,5,10,... trials instead of powers of 10...
Sander [Sat, 2 May 2020 16:12:05 +0000 (18:12 +0200)] 
bpo-40419: timeit CLI docs now mention 1,2,5,10,... trials instead of powers of 10 (GH-19752)

5 years agoCall $(MKDIR_P) before regenerating the PEG meta-parser (GH-19861)
Pablo Galindo [Sat, 2 May 2020 15:15:27 +0000 (16:15 +0100)] 
Call $(MKDIR_P) before regenerating the PEG meta-parser (GH-19861)

5 years agobpo-39435: Make the first argument of pickle.loads() positional-only. (GH-19846)
Serhiy Storchaka [Sat, 2 May 2020 06:38:01 +0000 (09:38 +0300)] 
bpo-39435: Make the first argument of pickle.loads() positional-only. (GH-19846)

It was positional-only de facto: documentation and two implementations
used three different name.

5 years agobpo-40334: regenerate metaparser as part of regen-all (GH-19854)
Pablo Galindo [Sat, 2 May 2020 04:23:39 +0000 (05:23 +0100)] 
bpo-40334: regenerate metaparser as part of regen-all (GH-19854)

5 years agoFix some scripts in the peg generator folder (GH-19853)
Pablo Galindo [Sat, 2 May 2020 04:23:06 +0000 (05:23 +0100)] 
Fix some scripts in the peg generator folder (GH-19853)

5 years agobpo-29587: Update gen.throw() to chain exceptions (#19823)
Chris Jerdonek [Sat, 2 May 2020 01:14:19 +0000 (18:14 -0700)] 
bpo-29587: Update gen.throw() to chain exceptions (#19823)

Before this commit, if an exception was active inside a generator
when calling gen.throw(), that exception was lost (i.e. there was
no implicit exception chaining).  This commit fixes that by
setting exc.__context__ when calling gen.throw(exc).

5 years agobpo-40417: Fix deprecation warning in PyImport_ReloadModule (GH-19750)
Robert Rouhani [Fri, 1 May 2020 23:28:06 +0000 (16:28 -0700)] 
bpo-40417: Fix deprecation warning in PyImport_ReloadModule (GH-19750)

I can add another commit with the new test case I wrote to verify that the warning was being printed before my change, stopped printing after my change, and that the function does not return null after my change.

Automerge-Triggered-By: @brettcannon
5 years agobpo-40334: use the TOKENS file when checking dangling rules (GH-19849)
Pablo Galindo [Fri, 1 May 2020 22:14:12 +0000 (23:14 +0100)] 
bpo-40334: use the TOKENS file when checking dangling rules (GH-19849)

5 years agoFix the Tools/peg_generator/scripts/benchmark.py script (GH-19848)
Pablo Galindo [Fri, 1 May 2020 21:33:54 +0000 (22:33 +0100)] 
Fix the Tools/peg_generator/scripts/benchmark.py script (GH-19848)

5 years agobpo-39435: Fix docs for pickle.loads (GH-18160)
Shantanu [Fri, 1 May 2020 19:46:01 +0000 (12:46 -0700)] 
bpo-39435: Fix docs for pickle.loads (GH-18160)