]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-16396: fix BPO number in changelog (GH-23951)
Shantanu [Sat, 26 Dec 2020 15:36:56 +0000 (09:36 -0600)] 
bpo-16396: fix BPO number in changelog (GH-23951)

Automerge-Triggered-By: GH:jaraco
4 years agobpo-42748: test_asdl_parser now uses exec_module instead of load_module (#23954)
Dong-hee Na [Sat, 26 Dec 2020 13:25:21 +0000 (22:25 +0900)] 
bpo-42748: test_asdl_parser now uses exec_module instead of load_module (#23954)

4 years agobpo-40521: Per-interpreter interned strings (GH-20085)
Victor Stinner [Sat, 26 Dec 2020 01:58:33 +0000 (02:58 +0100)] 
bpo-40521: Per-interpreter interned strings (GH-20085)

Make the Unicode dictionary of interned strings compatible with
subinterpreters.

Remove the INTERN_NAME_STRINGS macro in typeobject.c: names are
always now interned (even if EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
macro is defined).

_PyUnicode_ClearInterned() now uses PyDict_Next() to no longer
allocate memory, to ensure that the interned dictionary is cleared.

4 years agobpo-42694: Prevent creating _curses_panel.panel (GH-23948)
Victor Stinner [Sat, 26 Dec 2020 01:17:46 +0000 (02:17 +0100)] 
bpo-42694: Prevent creating _curses_panel.panel (GH-23948)

Fix regression introduced in
commit 1baf030a902392fe92d934ed0fb6a385cf7d8869: restore removed code
to prevent creating a _curses_panel.panel instance directly.

4 years agobpo-42745: Make the type cache per-interpreter (GH-23947)
Victor Stinner [Sat, 26 Dec 2020 00:45:43 +0000 (01:45 +0100)] 
bpo-42745: Make the type cache per-interpreter (GH-23947)

Make the type attribute lookup cache per-interpreter.

Add private _PyType_InitCache() function, called by PyInterpreterState_New().

Continue to share next_version_tag between interpreters, since static
types are still shared by interpreters.

Remove MCACHE macro: the cache is no longer disabled if the
EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined.

4 years agoAdd convolve() to the itertools recipes (GH-23928)
Raymond Hettinger [Sat, 26 Dec 2020 00:43:20 +0000 (16:43 -0800)] 
Add convolve() to the itertools recipes (GH-23928)

4 years agobpo-39465: Fix _PyUnicode_FromId() for subinterpreters (GH-20058)
Victor Stinner [Fri, 25 Dec 2020 23:41:46 +0000 (00:41 +0100)] 
bpo-39465: Fix _PyUnicode_FromId() for subinterpreters (GH-20058)

Make _PyUnicode_FromId() function compatible with subinterpreters.
Each interpreter now has an array of identifier objects (interned
strings decoded from UTF-8).

* Add PyInterpreterState.unicode.identifiers: array of identifiers
  objects.
* Add _PyRuntimeState.unicode_ids used to allocate unique indexes
  to _Py_Identifier.
* Rewrite the _Py_Identifier structure.

Microbenchmark on _PyUnicode_FromId(&PyId_a) with _Py_IDENTIFIER(a):

[ref] 2.42 ns +- 0.00 ns -> [atomic] 3.39 ns +- 0.00 ns: 1.40x slower

This change adds 1 ns per _PyUnicode_FromId() call in average.

4 years agoSync what's new in 3.9 with 3.9 branch (GH-23943)
Ken Jin [Fri, 25 Dec 2020 23:08:17 +0000 (07:08 +0800)] 
Sync what's new in 3.9 with 3.9 branch (GH-23943)

4 years agobpo-36876: [c-analyzer tool] Additional CLI updates for "capi" command. (gh-23929)
Eric Snow [Fri, 25 Dec 2020 22:57:30 +0000 (15:57 -0700)] 
bpo-36876: [c-analyzer tool] Additional CLI updates for "capi" command. (gh-23929)

https://bugs.python.org/issue36876

4 years agoRename Tkinter tests for widget options (GH-23944)
Serhiy Storchaka [Fri, 25 Dec 2020 22:10:29 +0000 (00:10 +0200)] 
Rename Tkinter tests for widget options (GH-23944)

Every test for widget option starts now with "test_configure_"
to distinguish it from tests for widget commands.

4 years agobpo-35728: Add root parameter to tkinter.font.nametofont() (GH-23885)
Desmond Cheong [Fri, 25 Dec 2020 21:18:06 +0000 (05:18 +0800)] 
bpo-35728: Add root parameter to tkinter.font.nametofont() (GH-23885)

4 years agobpo-42721: Improve using simple dialogs without root window (GH-23897)
Serhiy Storchaka [Fri, 25 Dec 2020 18:19:20 +0000 (20:19 +0200)] 
bpo-42721: Improve using simple dialogs without root window (GH-23897)

When simple query dialogs (tkinter.simpledialog), message boxes
(tkinter.messagebox) or color choose dialog (tkinter.colorchooser)
are created without arguments master and parent, and the default
root window is not yet created, a new temporary hidden root window
will be created automatically. It will not be set as the default root
window and will be destroyed right after closing the dialog window.
It will help to use these simple dialog windows in programs which do
not need other GUI.

Previously, message boxes and color chooser created the blank root
window and left it after closing the dialog window, and query dialogs
just raised an exception.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 years agobpo-28964: add line number of node (if available) to ast.literal_eval error messages...
Irit Katriel [Fri, 25 Dec 2020 17:04:31 +0000 (17:04 +0000)] 
bpo-28964: add line number of node (if available) to ast.literal_eval error messages (GH-23677)

4 years agobpo-15303: Support widgets with boolean value False in Tkinter (GH-23904)
Serhiy Storchaka [Fri, 25 Dec 2020 15:04:26 +0000 (17:04 +0200)] 
bpo-15303: Support widgets with boolean value False in Tkinter (GH-23904)

Use `widget is None` instead of checking the boolean value of a widget.

4 years agobpo-42734: Fix crasher bogus_code_obj.py (GH-23939)
Serhiy Storchaka [Fri, 25 Dec 2020 15:03:37 +0000 (17:03 +0200)] 
bpo-42734: Fix crasher bogus_code_obj.py (GH-23939)

It did not work because the signature of code object constructor
was changed. Also, it used old format of bytecode (pre-wordcode).

4 years agobpo-29076: Add fish support to macOS installer (GH-23302)
Erlend Egeberg Aasland [Fri, 25 Dec 2020 11:01:30 +0000 (12:01 +0100)] 
bpo-29076: Add fish support to macOS installer (GH-23302)

4 years agobpo-42388: Fix subprocess.check_output input=None when text=True (GH-23467)
Gregory P. Smith [Fri, 25 Dec 2020 04:57:21 +0000 (20:57 -0800)] 
bpo-42388: Fix subprocess.check_output input=None when text=True (GH-23467)

When the modern text= spelling of the universal_newlines= parameter was added
for Python 3.7, check_output's special case around input=None was overlooked.
So it behaved differently with universal_newlines=True vs text=True.  This
reconciles the behavior to be consistent and adds a test to guarantee it.

Also clarifies the existing check_output documentation.

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
4 years agobpo-42727: Fix the NEWS entry .rst (GH-23932)
Gregory P. Smith [Fri, 25 Dec 2020 04:31:18 +0000 (20:31 -0800)] 
bpo-42727: Fix the NEWS entry .rst (GH-23932)

It was causing CI failures.  the offending file came from https://github.com/python/cpython/pull/23917

```
python3 tools/rstlint.py ../Misc/NEWS.d/next/
[2] ../Misc/NEWS.d/next/Library/2020-12-23-19-43-06.bpo-42727.WH3ODh.rst:1: default role used
[2] ../Misc/NEWS.d/next/Library/2020-12-23-19-43-06.bpo-42727.WH3ODh.rst:2: default role used
2 problems with severity 2 found.
Makefile:204: recipe for target 'check' failed
```

4 years agobpo-42727: [Enum] use super() and include **kwds (GH-23927)
Ethan Furman [Fri, 25 Dec 2020 03:31:10 +0000 (19:31 -0800)] 
bpo-42727: [Enum] use super() and include **kwds (GH-23927)

for multiple inheritance support:

use super().new
pass **kwds to super().new

4 years agobpo-42685: Improve placing of simple query windows. (GH-23856)
Serhiy Storchaka [Thu, 24 Dec 2020 18:26:28 +0000 (20:26 +0200)] 
bpo-42685: Improve placing of simple query windows. (GH-23856)

* If parent is specified and mapped, the query widget is
  centered at the center of parent. Its position and size
  can be corrected so that it fits in the virtual root window.
* Otherwise it is centered at the center of the screen.

4 years ago[Enum] EnumMeta.__prepare__ now accepts **kwds (#23917)
Ethan Furman [Thu, 24 Dec 2020 18:05:02 +0000 (10:05 -0800)] 
[Enum] EnumMeta.__prepare__ now accepts **kwds (#23917)

4 years agobpo-36876: [c-analyzer tool] Add a "capi" subcommand to the c-analyzer tool. (gh...
Eric Snow [Thu, 24 Dec 2020 18:04:19 +0000 (11:04 -0700)] 
bpo-36876: [c-analyzer tool] Add a "capi" subcommand to the c-analyzer tool. (gh-23918)

This will help identify which C-API items will need to be updated for subinterpreter support.

https://bugs.python.org/issue36876

4 years agocloses bpo-42726: gdb libpython: InstanceProxy support for py3 (GH-23912)
Augusto Hack [Thu, 24 Dec 2020 17:16:04 +0000 (18:16 +0100)] 
closes bpo-42726: gdb libpython: InstanceProxy support for py3 (GH-23912)

On Fedora 31 gdb is using python 3.7.9, calling `proxyval` on an instance with a dictionary fails because of the `dict.iteritems` usage. This PR changes the code to be compatible with py2 and py3.

This changed seemed small enough to not need an issue and news blurb, if one is required please let me know.

Automerge-Triggered-By: GH:benjaminp
4 years agoGH: Add isidentical to the CODEOWNERS (GH-23923)
Batuhan Taskaya [Thu, 24 Dec 2020 11:30:46 +0000 (14:30 +0300)] 
GH: Add isidentical to the CODEOWNERS (GH-23923)

4 years agobpo-41559: Implement PEP 612 - Add ParamSpec and Concatenate to typing (#23702)
kj [Thu, 24 Dec 2020 04:33:48 +0000 (12:33 +0800)] 
bpo-41559: Implement PEP 612 - Add ParamSpec and Concatenate to typing (#23702)

4 years agobpo-38308: Add optional weighting to statistics.harmonic_mean() (GH-23914)
Raymond Hettinger [Thu, 24 Dec 2020 03:52:09 +0000 (19:52 -0800)] 
bpo-38308: Add optional weighting to statistics.harmonic_mean() (GH-23914)

4 years agobpo-42195: Override _CallableGenericAlias's __getitem__ (GH-23915)
kj [Thu, 24 Dec 2020 02:47:40 +0000 (10:47 +0800)] 
bpo-42195: Override _CallableGenericAlias's __getitem__ (GH-23915)

Added `__getitem__` for `_CallableGenericAlias` so that it returns a subclass (itself) of `types.GenericAlias` rather than the default behavior of returning a plain `types.GenericAlias`. This fixes `repr` issues occuring after `TypeVar` substitution arising from the previous behavior.

4 years agobpo-41960: Add globalns and localns parameters to inspect.signature and Signature...
Batuhan Taskaya [Wed, 23 Dec 2020 22:45:13 +0000 (01:45 +0300)] 
bpo-41960: Add globalns and localns parameters to inspect.signature and Signature.from_callable (GH-22583)

4 years agobpo-25246: Optimize deque.remove() (GH-23898)
Raymond Hettinger [Wed, 23 Dec 2020 19:45:06 +0000 (11:45 -0800)] 
bpo-25246: Optimize deque.remove() (GH-23898)

4 years agobpo-32381: pymain_run_command() uses PyCF_IGNORE_COOKIE (GH-23724)
Victor Stinner [Wed, 23 Dec 2020 18:16:56 +0000 (19:16 +0100)] 
bpo-32381: pymain_run_command() uses PyCF_IGNORE_COOKIE (GH-23724)

The coding cookie (ex: "# coding: latin1") is now ignored in the
command passed to the -c command line option.

Since pymain_run_command() uses UTF-8, pass PyCF_IGNORE_COOKIE
compiler flag to the parser.

pymain_run_python() no longer propages compiler flags between
function calls.

4 years agobpo-9694: Fix misleading phrase "optional arguments" (GH-23858)
Raymond Hettinger [Wed, 23 Dec 2020 17:40:56 +0000 (09:40 -0800)] 
bpo-9694: Fix misleading phrase "optional arguments" (GH-23858)

4 years agobpo-28468: Fix typo in _os_release_candidates (GH-23913)
Victor Stinner [Wed, 23 Dec 2020 16:35:53 +0000 (17:35 +0100)] 
bpo-28468: Fix typo in _os_release_candidates (GH-23913)

Automerge-Triggered-By: GH:tiran
4 years agobpo-42246: Don't eliminate jumps to jumps, if it will break PEP 626. (GH-23896)
Mark Shannon [Wed, 23 Dec 2020 11:43:10 +0000 (11:43 +0000)] 
bpo-42246: Don't eliminate jumps to jumps, if it will break PEP 626. (GH-23896)

4 years agoBPO-42703: Fix incorrect documentation links for asyncio.Event (GH-23881)
Matt Fowler [Wed, 23 Dec 2020 10:44:52 +0000 (05:44 -0500)] 
BPO-42703: Fix incorrect documentation links for asyncio.Event (GH-23881)

4 years agobpo-1635741: Port resource extension module to module state (GH-23462)
Christian Heimes [Wed, 23 Dec 2020 07:55:11 +0000 (08:55 +0100)] 
bpo-1635741: Port resource extension module to module state (GH-23462)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-42620: Improve socket.getsockname doc string (GH-23742)
Christian Heimes [Wed, 23 Dec 2020 07:25:57 +0000 (08:25 +0100)] 
bpo-42620: Improve socket.getsockname doc string (GH-23742)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-39465: Add pycore_atomic_funcs.h header (GH-20766)
Victor Stinner [Wed, 23 Dec 2020 02:41:08 +0000 (03:41 +0100)] 
bpo-39465: Add pycore_atomic_funcs.h header (GH-20766)

Add pycore_atomic_funcs.h internal header file: similar to
pycore_atomic.h but don't require to declare variables as atomic.

Add _Py_atomic_size_get() and _Py_atomic_size_set() functions.

4 years agoFix typos in sysmodule (GH-23883)
Joannah Nanjekye [Tue, 22 Dec 2020 22:31:46 +0000 (18:31 -0400)] 
Fix typos in sysmodule (GH-23883)

4 years agobpo-34463: Make python tracebacks identical to C tracebacks for SyntaxErrors without...
Irit Katriel [Tue, 22 Dec 2020 19:53:09 +0000 (19:53 +0000)] 
bpo-34463: Make python tracebacks identical to C tracebacks for SyntaxErrors without a lineno (GH-23427)

4 years agobpo-29030: Document interaction between *choices* and *metavar*. (GH-23884)
Raymond Hettinger [Tue, 22 Dec 2020 17:24:26 +0000 (09:24 -0800)] 
bpo-29030: Document interaction between *choices* and *metavar*. (GH-23884)

4 years ago[doc] Fix missing commas in signatures (#23693)
Andre Delfino [Tue, 22 Dec 2020 16:02:52 +0000 (13:02 -0300)] 
[doc] Fix missing commas in signatures (#23693)

* Fix star in signatures

* Fix comma in signatures

4 years agobpo-42688: Fix ffi alloc/free when using external libffi on macos (GH-23868)
erykoff [Tue, 22 Dec 2020 11:12:07 +0000 (03:12 -0800)] 
bpo-42688: Fix ffi alloc/free when using external libffi on macos (GH-23868)

Automerge-Triggered-By: GH:ronaldoussoren
4 years agobpo-39159: Declare error that might be raised from literal_eval (GH-19899)
Batuhan Taskaya [Tue, 22 Dec 2020 00:15:40 +0000 (03:15 +0300)] 
bpo-39159: Declare error that might be raised from literal_eval (GH-19899)

4 years agobpo-42008: Fix internal _random.Random() seeding for the one argument case (GH-22668)
AMIR [Mon, 21 Dec 2020 23:45:50 +0000 (03:15 +0330)] 
bpo-42008: Fix internal _random.Random() seeding for the one argument case (GH-22668)

4 years agoFix typo in docstring (GH-23515)
Fernando Toledo [Mon, 21 Dec 2020 14:06:31 +0000 (11:06 -0300)] 
Fix typo in docstring (GH-23515)

4 years agobpo-42634: Mark reraise after except blocks as artificial. (GH-23877)
Mark Shannon [Mon, 21 Dec 2020 13:53:50 +0000 (13:53 +0000)] 
bpo-42634: Mark reraise after except blocks as artificial. (GH-23877)

* Mark reraise after except blocks as artificial.

* Update importlib

* Update dis test.

4 years agobpo-35790: Correct the description of sys.exc_info() and add a code example (GH-11625)
Géry Ogam [Mon, 21 Dec 2020 13:13:08 +0000 (14:13 +0100)] 
bpo-35790: Correct the description of sys.exc_info() and add a code example (GH-11625)

4 years ago[WIP/RFC] bpo-15872: tests: remove oddity from test_rmtree_errors (GH-22967)
Daniel Hahler [Mon, 21 Dec 2020 06:38:02 +0000 (07:38 +0100)] 
[WIP/RFC] bpo-15872: tests: remove oddity from test_rmtree_errors (GH-22967)

This was added for (some) Windows buildbots back in 2012, and should
either not be necessary anymore, or it should probably get investigated
why "\*.*" gets added to filenames in the first place.

Ref:

Automerge-Triggered-By: GH:hynek
4 years agobpo-31904: Fix site and sysconfig modules for VxWorks RTOS (GH-21821)
pxinwr [Sun, 20 Dec 2020 22:27:42 +0000 (06:27 +0800)] 
bpo-31904: Fix site and sysconfig modules for VxWorks RTOS (GH-21821)

4 years agobpo-42669: Document that `except` rejects nested tuples (GH-23822)
Colin Watson [Sun, 20 Dec 2020 18:24:10 +0000 (18:24 +0000)] 
bpo-42669: Document that `except` rejects nested tuples (GH-23822)

In Python 2, it was possible to use `except` with a nested tuple, and occasionally natural.  For example, `zope.formlib.interfaces.InputErrors` is a tuple of several exception classes, and one might reasonably think to do something like this:

    try:
        self.getInputValue()
        return True
    except (InputErrors, SomethingElse):
        return False

As of Python 3.0, this raises `TypeError: catching classes that do not inherit from BaseException is not allowed` instead: one must instead either break it up into multiple `except` clauses or flatten the tuple.  However, the reference documentation was never updated to match this new restriction.  Make it clear that the definition is no longer recursive.

Automerge-Triggered-By: GH:ericvsmith
4 years agobpo-42572: Improve argparse docs for the type parameter. (GH-23849)
Raymond Hettinger [Sun, 20 Dec 2020 18:14:54 +0000 (10:14 -0800)] 
bpo-42572:  Improve argparse docs for the type parameter. (GH-23849)

4 years agobpo-42604: always set EXT_SUFFIX=${SOABI}${SHLIB_SUFFIX} when using configure (GH...
Matti Picus [Sun, 20 Dec 2020 02:56:57 +0000 (04:56 +0200)] 
bpo-42604: always set EXT_SUFFIX=${SOABI}${SHLIB_SUFFIX} when using configure (GH-23708)

Now all platforms use a value for the "EXT_SUFFIX" build variable derived
from SOABI (for instance in FreeBSD, "EXT_SUFFIX" is now ".cpython-310d.so"
instead of ".so"). Previously only Linux, Mac and VxWorks were using a value
for "EXT_SUFFIX" that included "SOABI".

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
4 years agobpo-41724: Explain when the conversion is not possible with detect_types enabled...
sblondon [Sat, 19 Dec 2020 22:52:39 +0000 (23:52 +0100)] 
bpo-41724: Explain when the conversion is not possible with detect_types enabled (GH-23855)

* Explain when the conversion is not possible with detect_types enabled

4 years ago[doc] Mention with and except clauses in globals() (GH-13232)
Andre Delfino [Sat, 19 Dec 2020 15:48:06 +0000 (12:48 -0300)] 
[doc] Mention with and except clauses in globals() (GH-13232)

4 years agobpo-42630: Improve error reporting in Tkinter for absent default root (GH-23781)
Serhiy Storchaka [Sat, 19 Dec 2020 10:17:08 +0000 (12:17 +0200)] 
bpo-42630: Improve error reporting in Tkinter for absent default root (GH-23781)

* Tkinter functions and constructors which need a default root window
  raise now RuntimeError with descriptive message instead of obscure
  AttributeError or NameError if it is not created yet or cannot
  be created automatically.

* Add tests for all functions which use default root window.

* Fix import in the pynche script.

4 years agobpo-42470: Do not warn on sequences which are also sets in random.sample() (GH-23665)
masklinn [Sat, 19 Dec 2020 04:33:36 +0000 (05:33 +0100)] 
bpo-42470: Do not warn on sequences which are also sets in random.sample() (GH-23665)

4 years agoFixed typo in itertools documentation (GH-23816)
Casper Smet [Sat, 19 Dec 2020 04:28:21 +0000 (05:28 +0100)] 
Fixed typo in itertools documentation (GH-23816)

4 years agobpo-42559: Not that getrandbits() is non-negative. (GH-23843)
Raymond Hettinger [Sat, 19 Dec 2020 01:03:10 +0000 (17:03 -0800)] 
bpo-42559: Not that getrandbits() is non-negative. (GH-23843)

4 years agobpo-34805: Guarantee that __subclasses__() is in definition order. (GH-23844)
Raymond Hettinger [Sat, 19 Dec 2020 00:53:50 +0000 (16:53 -0800)] 
bpo-34805:  Guarantee that __subclasses__() is in definition order. (GH-23844)

4 years agobpo-24792: Fix zipimporter masking the cause of import errors (GH-22204)
Irit Katriel [Sat, 19 Dec 2020 00:09:54 +0000 (00:09 +0000)] 
bpo-24792: Fix zipimporter masking the cause of import errors (GH-22204)

zipimport's _unmarshal_code swallows import errors and then _get_module_code doesn't know the cause of the error, and returns the generic, and sometimes incorrect, 'could not find...'.

Automerge-Triggered-By: GH:brettcannon
4 years agobpo-36769: Document that fnmatch.filter supports any kind of iterable (#13039)
Andre Delfino [Fri, 18 Dec 2020 19:10:20 +0000 (16:10 -0300)] 
bpo-36769: Document that fnmatch.filter supports any kind of iterable (#13039)

4 years agobpo-34398: Allow glossary results to show up on search page (GH-8773)
Ammar Askar [Fri, 18 Dec 2020 19:00:51 +0000 (14:00 -0500)] 
bpo-34398: Allow glossary results to show up on search page (GH-8773)

4 years agobpo-42675: Document collections.abc.Callable changes (GH-23839)
kj [Fri, 18 Dec 2020 17:39:26 +0000 (01:39 +0800)] 
bpo-42675: Document collections.abc.Callable changes (GH-23839)

4 years agobpo-41891: ensure asyncio.wait_for waits for task completion (#22461)
Richard Kojedzinszky [Fri, 18 Dec 2020 17:26:04 +0000 (18:26 +0100)] 
bpo-41891: ensure asyncio.wait_for waits for task completion (#22461)

4 years agobpo-40956: Fix sqlite3 AC code (GH-23837)
Dong-hee Na [Fri, 18 Dec 2020 15:41:33 +0000 (00:41 +0900)] 
bpo-40956: Fix sqlite3 AC code (GH-23837)

4 years agobpo-40956: Convert _sqlite3.Connection to Argument Clinic (GH-23341)
Erlend Egeberg Aasland [Fri, 18 Dec 2020 14:25:35 +0000 (15:25 +0100)] 
bpo-40956: Convert _sqlite3.Connection to Argument Clinic (GH-23341)

4 years agobpo-17140: Document multiprocessing's ThreadPool (GH-23812)
Matt Wozniski [Fri, 18 Dec 2020 13:05:46 +0000 (08:05 -0500)] 
bpo-17140: Document multiprocessing's ThreadPool (GH-23812)

Up until now, the `multiprocessing.pool.ThreadPool` class has gone
undocumented, despite being a public class in multiprocessing that is
included in `multiprocessing.pool.__all__`.

4 years agobpo-42238: Check Misc/NEWS.d/next/ for reStructuredText issues. (GH-23802)
Julien Palard [Fri, 18 Dec 2020 09:48:08 +0000 (10:48 +0100)] 
bpo-42238: Check Misc/NEWS.d/next/ for reStructuredText issues. (GH-23802)

4 years agobpo-39096: Format specification documentation fixes for numeric types (GH-23575)
Mark Dickinson [Fri, 18 Dec 2020 09:24:06 +0000 (09:24 +0000)] 
bpo-39096: Format specification documentation fixes for numeric types (GH-23575)

4 years agobpo-1635741: Port _thread to multiphase init (GH-23811)
Victor Stinner [Fri, 18 Dec 2020 00:39:00 +0000 (01:39 +0100)] 
bpo-1635741: Port _thread to multiphase init (GH-23811)

Port the _thread extension module to the multiphase initialization
API (PEP 489) and convert its static types to heap types.

Add a traverse function to the lock type, so the garbage collector
can break reference cycles.

4 years agobpo-42199: Fix bytecode_helper assertNotInBytecode (#23031)
Max Bernstein [Fri, 18 Dec 2020 00:30:29 +0000 (16:30 -0800)] 
bpo-42199: Fix bytecode_helper assertNotInBytecode (#23031)

* bpo-42199: Fix bytecode_helper assertNotInBytecode

Add tests.

* ðŸ“œðŸ¤– Added by blurb_it.

Co-authored-by: Dino Viehland <dinoviehland@fb.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
4 years agobpo-42670: Fix a missing word in the itertools.product() docs (GH-23823)
Zackery Spytz [Thu, 17 Dec 2020 20:24:43 +0000 (13:24 -0700)] 
bpo-42670: Fix a missing word in the itertools.product() docs (GH-23823)

4 years agobpo-31904: posixpath.expanduser() handles None user home on VxWorks (GH-23530)
pxinwr [Thu, 17 Dec 2020 19:22:29 +0000 (03:22 +0800)] 
bpo-31904: posixpath.expanduser() handles None user home on VxWorks (GH-23530)

4 years ago[doc] Fix a few margins due to bad markup (GH-23619)
Andre Delfino [Thu, 17 Dec 2020 17:25:55 +0000 (14:25 -0300)] 
[doc] Fix a few margins due to bad markup (GH-23619)

4 years agobpo-42246: Make sure that `f_lasti`, and thus `f_lineno`, is set correctly after...
Mark Shannon [Thu, 17 Dec 2020 13:55:28 +0000 (13:55 +0000)] 
bpo-42246: Make sure that `f_lasti`, and thus `f_lineno`, is set correctly after raising or reraising an exception (GH-23803)

* Ensure that f_lasti is set correctly after an exception is raised to conform to PEP 626.

* Update importlib

* Add NEWS.

4 years agobpo-26564: fix obsolete comment in traceback.c (GH-23819)
Irit Katriel [Thu, 17 Dec 2020 12:33:07 +0000 (12:33 +0000)] 
bpo-26564: fix obsolete comment in traceback.c (GH-23819)

4 years agobpo-31904: Skip some asyncio tests on VxWorks (#23815)
pxinwr [Thu, 17 Dec 2020 10:04:47 +0000 (18:04 +0800)] 
bpo-31904: Skip some asyncio tests on VxWorks (#23815)

4 years ago[doc] Fix erroneous backslashes in signatures and names (GH-23658)
Andre Delfino [Thu, 17 Dec 2020 01:37:28 +0000 (22:37 -0300)] 
[doc] Fix erroneous backslashes in signatures and names (GH-23658)

The issue being resolved is shown in the 3.10 docs (if you select docs for older versions you won't see a visual glitch).

The newer sphinx version that produces the 3.10 docs doesn't treat the backslash to escape things in some situations it previously did.

4 years agoCorrect referenced RFC number in cgi module (GH-22827)
Mike Lei [Thu, 17 Dec 2020 01:34:19 +0000 (01:34 +0000)] 
Correct referenced RFC number in cgi module (GH-22827)

The quoted sentence can be found from the last paragraph of RFC 2046, Section 5.1, while the content of RFC 2026 is unrelated to this module.

4 years agoFix indentation for get_stats_profile() docs (GH-23618)
Matthew Suozzo [Wed, 16 Dec 2020 23:17:22 +0000 (18:17 -0500)] 
Fix indentation for get_stats_profile() docs (GH-23618)

The existing method is indented one too many times which
makes it look like a sub-method of print_callees().

4 years agobpo-37961: Fix regression in tracemalloc.Traceback.__repr__ (GH-23805)
Daniel Hahler [Wed, 16 Dec 2020 21:38:32 +0000 (22:38 +0100)] 
bpo-37961: Fix regression in tracemalloc.Traceback.__repr__ (GH-23805)

Regression in 8d59eb1b66c51b2b918da9881c57d07d08df43b7.

4 years agobpo-38323: Add guard clauses in MultiLoopChildWatcher. (#22756)
Chris Jerdonek [Wed, 16 Dec 2020 17:50:25 +0000 (09:50 -0800)] 
bpo-38323: Add guard clauses in MultiLoopChildWatcher. (#22756)

This is a trivial refactor in preparation for a fix for bpo-38323.

4 years agobpo-23915: update and elucidate documentation of with_traceback (GH-23680)
Irit Katriel [Wed, 16 Dec 2020 16:03:32 +0000 (16:03 +0000)] 
bpo-23915: update and elucidate documentation of with_traceback (GH-23680)

4 years agoClarify eval() doc from library/functions. (GH-22700)
Antoine [Wed, 16 Dec 2020 15:45:19 +0000 (16:45 +0100)] 
Clarify eval() doc from library/functions. (GH-22700)

4 years agobpo-40686: Fix compiler warnings on _zoneinfo.c (GH-23614)
Victor Stinner [Wed, 16 Dec 2020 15:26:15 +0000 (16:26 +0100)] 
bpo-40686: Fix compiler warnings on _zoneinfo.c (GH-23614)

"uint8_t day" is unsigned and so "day < 0" test is always true.
Remove the test to fix the following warnings on Windows:

modules\_zoneinfo.c(1224): warning C4068: unknown pragma
modules\_zoneinfo.c(1225): warning C4068: unknown pragma
modules\_zoneinfo.c(1227): warning C4068: unknown pragma

4 years agoFix reStructuredText typo in NEWS.d. (GH-23800)
Julien Palard [Wed, 16 Dec 2020 15:22:19 +0000 (16:22 +0100)] 
Fix reStructuredText typo in NEWS.d. (GH-23800)

4 years agoAdd symbols of the stable ABI to python3dll.c (GH-23598)
Victor Stinner [Wed, 16 Dec 2020 14:08:23 +0000 (15:08 +0100)] 
Add symbols of the stable ABI to python3dll.c (GH-23598)

Add the following symbols to python3dll.c:

* PyFrame_GetCode (bpo-40421)
* PyFrame_GetLineNumber (bpo-40421)
* PyModule_AddObjectRef (bpo-1635741)
* PyObject_CallNoArgs (bpo-37194)
* PyThreadState_GetFrame (bpo-39947)
* PyThreadState_GetID (bpo-39947)
* PyThreadState_GetInterpreter (bpo-39947)

4 years agobpo-42645: Make sure that return/break/continue are only traced once when exiting...
Mark Shannon [Wed, 16 Dec 2020 13:07:01 +0000 (13:07 +0000)] 
bpo-42645: Make sure that return/break/continue are only traced once when exiting via a finally block. (GH-23780)

* Make sure that return/break/continue are only traced once when exiting via a finally block.

* Add test for return in try-finally.

* Update importlib

4 years agobpo-42615: Delete redundant jump instructions that only bypass empty blocks (GH-23733)
Om G [Wed, 16 Dec 2020 12:18:05 +0000 (17:48 +0530)] 
bpo-42615: Delete redundant jump instructions that only bypass empty blocks (GH-23733)

* Delete jump instructions that bypass empty blocks

* Add news entry

* Explicitly check for unconditional jump opcodes

Using the is_jump function results in the inclusion of instructions like
returns for which this optimization is not really valid. So, instead
explicitly check that the instruction is an unconditional jump.

* Handle conditional jumps, delete jumps gracefully

* Ensure b_nofallthrough and b_reachable are valid

* Add test for redundant jumps

* Regenerate importlib.h and edit Misc/ACKS

* Fix bad whitespace

4 years agobpo-1635741: Refactor _threadmodule.c (GH-23793)
Victor Stinner [Wed, 16 Dec 2020 11:20:33 +0000 (12:20 +0100)] 
bpo-1635741: Refactor _threadmodule.c (GH-23793)

* Fix ExceptHookArgsType name: "_thread.ExceptHookArgs", instead of
  "_thread._ExceptHookArgs".
* PyInit__thread() no longer intializes interp->num_threads to 0:
  it is already done in PyInterpreterState_New().
* Use PyModule_AddType(), Py_NewRef() and Py_XNewRef().
* Replace str_dict variable with _Py_IDENTIFIER(__dict__).
* Remove assert(Py_IS_TYPE(obj, &Locktype)) from release_sentinel()
  to avoid having to retrive the type from this callback.
* Add thread_bootstate_free()
* Rename t_bootstrap() to thread_run()
* bootstate structure: rename keyw member to kwargs

4 years agobpo-42613: Fix freeze.py config directory (GH-23792)
Victor Stinner [Wed, 16 Dec 2020 11:12:36 +0000 (12:12 +0100)] 
bpo-42613: Fix freeze.py config directory (GH-23792)

Fix freeze.py tool to use the prope config and library directories.

4 years agobpo-40364: asyncio uses os.waitstatus_to_exitcode() (GH-23798)
Victor Stinner [Wed, 16 Dec 2020 11:11:24 +0000 (12:11 +0100)] 
bpo-40364: asyncio uses os.waitstatus_to_exitcode() (GH-23798)

test_unix_events.py no longer checks if waitstatus_to_exitcode() mock
has been called or not to make the test more functional, rather than
checking the exact implementation.

4 years agobpo-19733: Re-enable tests for -image option in Tkinter (GH-23785)
Serhiy Storchaka [Wed, 16 Dec 2020 10:31:49 +0000 (12:31 +0200)] 
bpo-19733: Re-enable tests for -image option in Tkinter (GH-23785)

4 years agobpo-41804: Enhance test_epoll.test_control_and_wait() (GH-23795)
Victor Stinner [Wed, 16 Dec 2020 10:16:25 +0000 (11:16 +0100)] 
bpo-41804: Enhance test_epoll.test_control_and_wait() (GH-23795)

Use shorter timeout and replace send() with sendall().

4 years agobpo-42644: Validate values in logging.disable() (#23786)
Matthias Bussonnier [Wed, 16 Dec 2020 09:43:39 +0000 (01:43 -0800)] 
bpo-42644: Validate values in logging.disable() (#23786)

* bpo-42644: Validate values in logging.disable()

Technically make the value of manager a property that checks and convert
values assigned to it properly. This has the side effect of making
`logging.disable` also accept strings representing the various level of
warnings.

We want to validate the type of the disable attribute at assignment
time, as it is later compared to other levels when emitting warnings and
would generate a `TypeError: '>=' not supported between ....` in a
different part of the code base, which can make it difficult to track
down.

When assigned an incorrect value; it will raise a TypeError when the
wrong type, or ValueError if an invalid str.

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
4 years agobpo-42179: Clarify exception chaining (GH-23160)
Vladimir [Wed, 16 Dec 2020 02:47:26 +0000 (18:47 -0800)] 
bpo-42179: Clarify exception chaining (GH-23160)

* Update errors.rst

Clarify exception chaining behaviour and give a reference to the library documentation.

* Update errors.rst

Wording

* Update errors.rst

Spelling

* Update errors.rst

Remove mentioning of special attributes as folks think it's too much for beginners.

4 years agoUpdate Stale action message (GH-23791)
Mariatta [Wed, 16 Dec 2020 02:36:33 +0000 (18:36 -0800)] 
Update Stale action message (GH-23791)

We don't close PRs after it becomes stale.

4 years agobpo-42090: zipfile.Path.joinpath now accepts multiple arguments (GH-22976)
Jason R. Coombs [Wed, 16 Dec 2020 02:12:54 +0000 (21:12 -0500)] 
bpo-42090: zipfile.Path.joinpath now accepts multiple arguments (GH-22976)

Automerge-Triggered-By: GH:jaraco
4 years agobpo-31904: Skip os.path.expanduser() tests on VxWorks (GH-23776)
pxinwr [Tue, 15 Dec 2020 21:24:00 +0000 (05:24 +0800)] 
bpo-31904: Skip os.path.expanduser() tests on VxWorks (GH-23776)

4 years agobpo-31904: Skip some tests of changing owner in _test_all_chown_common() on VxWorks...
pxinwr [Tue, 15 Dec 2020 21:21:53 +0000 (05:21 +0800)] 
bpo-31904: Skip some tests of changing owner in _test_all_chown_common() on VxWorks (GH-23716)