]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-42794: Update test_nntplib to use offical group name for testing (GH-24037)
Dong-hee Na [Fri, 1 Jan 2021 14:20:33 +0000 (23:20 +0900)] 
bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037)

4 years agobpo-42781: Document the mechanics of cached_property from a user viewpoint (GH-24031)
Raymond Hettinger [Fri, 1 Jan 2021 01:05:58 +0000 (17:05 -0800)] 
bpo-42781: Document the mechanics of cached_property from a user viewpoint (GH-24031)

4 years agobpo-37193: Remove thread objects which finished process its request (GH-23127)
Jason R. Coombs [Thu, 31 Dec 2020 20:19:30 +0000 (15:19 -0500)] 
bpo-37193: Remove thread objects which finished process its request (GH-23127)

This reverts commit aca67da4fe68d5420401ac1782203d302875eb27.

4 years agoFixes a typo in importlib.metadata. (#23921)
Tao He [Thu, 31 Dec 2020 19:37:53 +0000 (03:37 +0800)] 
Fixes a typo in importlib.metadata. (#23921)

Signed-off-by: Tao He <sighingnow@gmail.com>
4 years agobpo-42163, bpo-42189, bpo-42659: Support uname_tuple._replace (for all but processor...
Jason R. Coombs [Thu, 31 Dec 2020 19:08:03 +0000 (14:08 -0500)] 
bpo-42163, bpo-42189, bpo-42659: Support uname_tuple._replace (for all but processor) (#23010)

* Add test capturing missed expectation with uname_result._replace.

* bpo-42163: Override uname_result._make to allow uname_result._replace to work (for everything but 'processor'.

* Replace hard-coded length with one derived from the definition.

* Add test capturing missed expectation with copy/deepcopy on namedtuple (bpo-42189).

* bpo-42189: Exclude processor parameter when constructing uname_result.

* In _make, rely on __new__ to strip processor.

* Add blurb.

* iter is not necessary here.

* Rely on num_fields in __new__

* Add test for slices on uname

* Add test for copy and pickle.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* import pickle

* Fix equality test after pickling.

* Simply rely on __reduce__ for pickling.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-42382: In importlib.metadata, `EntryPoint` objects now expose `dist` (#23758)
Jason R. Coombs [Thu, 31 Dec 2020 17:56:43 +0000 (12:56 -0500)] 
bpo-42382: In importlib.metadata, `EntryPoint` objects now expose `dist` (#23758)

* bpo-42382: In importlib.metadata, `EntryPoint` objects now expose a `.dist` object referencing the `Distribution` when constructed from a `Distribution`.

Also, sync importlib_metadata 3.3:

- Add support for package discovery under package normalization rules.
- The object returned by `metadata()` now has a formally-defined protocol called `PackageMetadata` with declared support for the `.get_all()` method.

* Add blurb

* Remove latent footnote.

4 years agobpo-42393: Raise OverflowError iso. DeprecationWarning on overflow in socket.ntohs...
Erlend Egeberg Aasland [Thu, 31 Dec 2020 13:16:50 +0000 (14:16 +0100)] 
bpo-42393: Raise OverflowError iso. DeprecationWarning on overflow in socket.ntohs and socket.htons (GH-23980)

4 years agobpo-39068: Fix race condition in base64 (GH-17627)
Brandon Stansbury [Thu, 31 Dec 2020 09:44:46 +0000 (01:44 -0800)] 
bpo-39068: Fix race condition in base64 (GH-17627)

There was a race condition in base64 in lazy initialization of multiple globals.

4 years agoMinor improvements to the convolve() recipe (GH-24012)
Raymond Hettinger [Wed, 30 Dec 2020 20:51:19 +0000 (12:51 -0800)] 
Minor improvements to the convolve() recipe (GH-24012)

* Minor improvement to speed and space efficiency for the convolve() recipe
* Don't require convolve's kernel to be a sequence.

4 years agobpo-42773: fix tests not being run on pushes (GH-24004)
Filipe Laíns [Wed, 30 Dec 2020 14:53:58 +0000 (14:53 +0000)] 
bpo-42773: fix tests not being run on pushes (GH-24004)

There was a typo, we were checking if the "GITHUB_BASE_REF" string
literal was empty instead of the $GITHUB_BASE_REF value. When
$GITHUB_BASE_REF is empty, the action that triggered the run was not a
pull request, so we always run the full test suite.

Signed-off-by: Filipe Laíns <lains@riseup.net>
4 years agobpo-27640: Add --disable-test-modules configure option (GH-23886)
pxinwr [Wed, 30 Dec 2020 12:50:39 +0000 (20:50 +0800)] 
bpo-27640: Add --disable-test-modules configure option (GH-23886)

Added --disable-test-modules option to the configure script:
don't build nor install test modules.

Patch by Xavier de Gaye, Thomas Petazzoni and Peixing Xin.

Co-Authored-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
4 years agobpo-27794: Add `name` attribute to `property` class (GH-23967)
Yurii Karabas [Wed, 30 Dec 2020 09:51:24 +0000 (11:51 +0200)] 
bpo-27794: Add `name` attribute to `property` class (GH-23967)

4 years agobpo-40137: Fix refleak in _functools_exec() (GH-24006)
Victor Stinner [Wed, 30 Dec 2020 01:24:43 +0000 (02:24 +0100)] 
bpo-40137: Fix refleak in _functools_exec() (GH-24006)

4 years agobpo-40052: Fix alignment issue in PyVectorcall_Function() (GH-23999)
Petr Viktorin [Tue, 29 Dec 2020 23:32:07 +0000 (00:32 +0100)] 
bpo-40052: Fix alignment issue in PyVectorcall_Function() (GH-23999)

```
In file included from /usr/include/python3.8/Python.h:147:
In file included from /usr/include/python3.8/abstract.h:837:
/usr/include/python3.8/cpython/abstract.h:91:11: error: cast from 'char *' to 'vectorcallfunc *'
(aka 'struct _object *(**)(struct _object *, struct _object *const *, unsigned long, struct _object *)')
increases required alignment from 1 to 8 [-Werror,-Wcast-align]

    ptr = (vectorcallfunc*)(((char *)callable) + offset);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
Co-Authored-By: Andreas Schneider <asn@cryptomilk.org>
Co-Authored-By: Antoine Pitrou <antoine@python.org>
4 years agobpo-41224: Add versionadded for Symbol.is_annotated (GH-23861)
Andre Delfino [Tue, 29 Dec 2020 13:32:10 +0000 (10:32 -0300)] 
bpo-41224: Add versionadded for Symbol.is_annotated (GH-23861)

4 years agobpo-40956: Convert _sqlite3.Row to Argument Clinic (GH-23964)
Erlend Egeberg Aasland [Tue, 29 Dec 2020 13:22:55 +0000 (14:22 +0100)] 
bpo-40956: Convert _sqlite3.Row to Argument Clinic (GH-23964)

4 years agobpo-42655: Fix subprocess extra_groups gid conversion (GH-23762)
Jakub Kulík [Tue, 29 Dec 2020 12:58:27 +0000 (13:58 +0100)] 
bpo-42655: Fix subprocess extra_groups gid conversion (GH-23762)

4 years agobpo-40137: Convert _functools module to use PyType_FromModuleAndSpec. (GH-23405)
Hai Shi [Tue, 29 Dec 2020 12:45:07 +0000 (20:45 +0800)] 
bpo-40137: Convert _functools module to use PyType_FromModuleAndSpec. (GH-23405)

4 years agobpo-42700: Swap descriptions in pyexpat.errors (GH-23876)
Michael Wayne Goodman [Tue, 29 Dec 2020 12:33:15 +0000 (20:33 +0800)] 
bpo-42700: Swap descriptions in pyexpat.errors (GH-23876)

The descriptions of the `codes` and `messages` dictionaries in
`xml.parsers.expat.errors` were swapped, and this commit swaps them
back. For example, `codes` maps string descriptions of errors to numeric
error codes, not the other way around.

4 years agoFix minor typo in comments in readline.c (GH-23911)
Jero Bado [Tue, 29 Dec 2020 12:26:57 +0000 (20:26 +0800)] 
Fix minor typo in comments in readline.c (GH-23911)

4 years agoAllow / character in username,password fields in _PROXY envvars. (#23973)
Senthil Kumaran [Tue, 29 Dec 2020 12:18:42 +0000 (04:18 -0800)] 
Allow / character in username,password fields in _PROXY envvars. (#23973)

4 years agobpo-41781: Fix typo in internal function name in typing (GH-23957)
Ross [Tue, 29 Dec 2020 11:55:28 +0000 (11:55 +0000)] 
bpo-41781: Fix typo in internal function name in typing (GH-23957)

4 years agoFix typo in NEWS (GH23958)
Zackery Spytz [Tue, 29 Dec 2020 11:50:22 +0000 (04:50 -0700)] 
Fix typo in NEWS (GH23958)

4 years agobpo-42759: Fix equality comparison of Variable and Font in Tkinter (GH-23968)
Serhiy Storchaka [Tue, 29 Dec 2020 10:56:55 +0000 (12:56 +0200)] 
bpo-42759: Fix equality comparison of Variable and Font in Tkinter (GH-23968)

Objects which belong to different Tcl interpreters are now always
different, even if they have the same name.

4 years agobpo-42749: Use dynamic version to test for unsupported bignum in Tk (GH-23966)
Serhiy Storchaka [Tue, 29 Dec 2020 10:55:55 +0000 (12:55 +0200)] 
bpo-42749: Use dynamic version to test for unsupported bignum in Tk (GH-23966)

Tk can internally support bignum even if Tkinter is built without
support of bignum.

4 years agobpo-42770: Fix a typo in the email.headerregistry docs (GH-23982)
Zackery Spytz [Tue, 29 Dec 2020 04:12:37 +0000 (21:12 -0700)] 
bpo-42770: Fix a typo in the email.headerregistry docs (GH-23982)

Automerge-Triggered-By: GH:zware
4 years agobpo-42740: Support PEP 604, 612 for typing.py get_args and get_origin (GH-23942)
Ken Jin [Tue, 29 Dec 2020 02:26:19 +0000 (10:26 +0800)] 
bpo-42740: Support PEP 604, 612 for typing.py get_args and get_origin (GH-23942)

4 years agoFix compiler warnings regarding loss of data (GH-23983)
Pablo Galindo [Tue, 29 Dec 2020 00:28:09 +0000 (00:28 +0000)] 
Fix compiler warnings regarding loss of data (GH-23983)

4 years agoUse Py_NewRef in Modules/_struct.c (GH-23981)
Pablo Galindo [Mon, 28 Dec 2020 23:59:16 +0000 (23:59 +0000)] 
Use Py_NewRef in Modules/_struct.c (GH-23981)

4 years agobpo-42740: Fix get_args for PEP 585 collections.abc.Callable (GH-23963)
Ken Jin [Mon, 28 Dec 2020 20:06:19 +0000 (04:06 +0800)] 
bpo-42740: Fix get_args for PEP 585 collections.abc.Callable (GH-23963)

PR 1/2. Needs backport to 3.9.

4 years agobpo-42222: Modernize integer test/conversion in randrange() (#23064)
Raymond Hettinger [Mon, 28 Dec 2020 19:10:34 +0000 (11:10 -0800)] 
bpo-42222: Modernize integer test/conversion in randrange() (#23064)

4 years ago[workflow] Use MSVC problem matcher for Windows action build (GH-18532)
Ammar Askar [Mon, 28 Dec 2020 18:28:40 +0000 (13:28 -0500)] 
[workflow] Use MSVC problem matcher for Windows action build (GH-18532)

This makes warnings and errors from the compiler very prominent so this should help prevent warnings from sneaking into the code base and catch them in review. See https://discuss.python.org/t/using-github-problem-matchers-to-catch-warnings-early/4254 for more details

You can see a demo of this in action here: https://github.com/ammaraskar/cpython/pull/15/files#diff-9ba2eeca0f254ece0a9df4d7cb68e870

GCC and Sphinx matchers have previously been added in GH-18567 and GH-20325, respectively.

4 years agobpo-40077: Fix typo in simplequeue_get_state_by_type() (GH-23975)
Erlend Egeberg Aasland [Mon, 28 Dec 2020 17:47:16 +0000 (18:47 +0100)] 
bpo-40077: Fix typo in simplequeue_get_state_by_type() (GH-23975)

The typo did no damage, but it looks suspicious and confusing.
Introduced by GH-23136.

Skip news.

Automerge-Triggered-By: GH:pitrou
4 years agobpo-1635741: sqlite3: Fix ref leak introduced by commit bf64d90 (GH-23972)
Erlend Egeberg Aasland [Mon, 28 Dec 2020 02:09:26 +0000 (03:09 +0100)] 
bpo-1635741: sqlite3: Fix ref leak introduced by commit bf64d90 (GH-23972)

4 years agobpo-42755: Fix sqlite3.Connection.backup docs (GH-23965)
Erlend Egeberg Aasland [Sun, 27 Dec 2020 22:35:17 +0000 (23:35 +0100)] 
bpo-42755: Fix sqlite3.Connection.backup docs (GH-23965)

The `pages` argument default value now reflects the implementation.

4 years agobpo-1635741: sqlite3 uses Py_NewRef/Py_XNewRef (GH-23170)
Erlend Egeberg Aasland [Sun, 27 Dec 2020 11:05:33 +0000 (12:05 +0100)] 
bpo-1635741: sqlite3 uses Py_NewRef/Py_XNewRef (GH-23170)

4 years agobpo-40956: Convert _sqlite3.Connection to Argument Clinic, part 2 (GH-23838)
Erlend Egeberg Aasland [Sun, 27 Dec 2020 08:32:18 +0000 (09:32 +0100)] 
bpo-40956: Convert _sqlite3.Connection to Argument Clinic, part 2 (GH-23838)

4 years agobpo-42749: Fix testing bignum if Tkinter is compiled with Tk 8.4 and dynamic linked...
Serhiy Storchaka [Sun, 27 Dec 2020 08:13:30 +0000 (10:13 +0200)] 
bpo-42749: Fix testing bignum if Tkinter is compiled with Tk 8.4 and dynamic linked with Tk >= 8.5 (GH-23955)

4 years agobpo-42745: finalize_interp_types() calls _PyType_Fini() (GH-23953)
Victor Stinner [Sat, 26 Dec 2020 19:26:08 +0000 (20:26 +0100)] 
bpo-42745: finalize_interp_types() calls _PyType_Fini() (GH-23953)

Call _PyType_Fini() in subinterpreters.

Fix reference leaks in subinterpreters.

4 years agoAdd small validator utility for PEG grammars (GH-23519)
Pablo Galindo [Sat, 26 Dec 2020 19:11:29 +0000 (19:11 +0000)] 
Add small validator utility for PEG grammars (GH-23519)

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