]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agobpo-40703: Let PyType_FromSpec() set "type.__module__" only if it is not set yet...
scoder [Wed, 10 Jun 2020 16:09:01 +0000 (18:09 +0200)] 
bpo-40703: Let PyType_FromSpec() set "type.__module__" only if it is not set yet. (GH-20273)

5 years agobpo-36543: Revert "bpo-36543: Remove the xml.etree.cElementTree module." (GH-20117)
Serhiy Storchaka [Wed, 10 Jun 2020 15:39:12 +0000 (18:39 +0300)] 
bpo-36543: Revert "bpo-36543: Remove the xml.etree.cElementTree module." (GH-20117)

* Revert "bpo-36543: Remove the xml.etree.cElementTree module. (GH-19108)"

This reverts commit b33e52511a59c6da7132c226b7f7489b092a33eb.

5 years agoRaise specialised syntax error for invalid lambda parameters (GH-20776)
Pablo Galindo [Wed, 10 Jun 2020 13:07:06 +0000 (14:07 +0100)] 
Raise specialised syntax error for invalid lambda parameters (GH-20776)

5 years agobpo-40275: Add os_helper submodule in test.support (GH-20765)
Hai Shi [Wed, 10 Jun 2020 12:29:02 +0000 (20:29 +0800)] 
bpo-40275: Add os_helper submodule in test.support (GH-20765)

5 years agobpo-40889: Optimize dict.items() ^ dict.items() (GH-20718)
Dennis Sweeney [Wed, 10 Jun 2020 05:56:56 +0000 (01:56 -0400)] 
bpo-40889: Optimize dict.items() ^ dict.items() (GH-20718)

5 years agobpo-32604: Recommit "bpo-32604: PEP 554 for use in test suite (GH-19985)" (GH-20611)
Joannah Nanjekye [Wed, 10 Jun 2020 03:53:23 +0000 (00:53 -0300)] 
bpo-32604: Recommit "bpo-32604: PEP 554 for use in test suite (GH-19985)" (GH-20611)

* PEP 554 for use in test suite

* 📜🤖 Added by blurb_it.

* Fix space

* Add doc to doc tree

* Move to modules doc tree

* Fix suspicious doc errors

* Fix test__all

* Docs docs docs

* Support isolated and fix wait

* Fix white space

* Remove undefined from __all__

* Fix recv and add exceptions

* Remove unused exceptions, fix pep 8 formatting errors and fix _NOT_SET in recv_nowait()

* Update Lib/test/support/interpreters.py

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* Remove documentation (module is for internal use)

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-34003: Re-add versionchanged entry in csv docs (GH-20657)
Éric Araujo [Wed, 10 Jun 2020 01:02:11 +0000 (21:02 -0400)] 
bpo-34003: Re-add versionchanged entry in csv docs (GH-20657)

Follow-up to GH-8014

5 years agoRemove usesless function from csv module (GH-20762)
Dong-hee Na [Tue, 9 Jun 2020 15:33:43 +0000 (00:33 +0900)] 
Remove usesless function from csv module (GH-20762)

5 years agobpo-40684: Fix make install for platlibdir=lib64 (GH-20736)
Victor Stinner [Tue, 9 Jun 2020 13:32:43 +0000 (15:32 +0200)] 
bpo-40684: Fix make install for platlibdir=lib64 (GH-20736)

"make install" now uses the PLATLIBDIR variable for the destination
lib-dynload/ directory when ./configure --with-platlibdir is used.

Update --with-platlibdir comment in configure.

5 years agoRemove reference to 3.7 and 3.8 backports. (GH-20754)
Stefan Krah [Tue, 9 Jun 2020 08:27:45 +0000 (10:27 +0200)] 
Remove reference to 3.7 and 3.8 backports. (GH-20754)

5 years agoMinor improvement to the namedtuple implementation (GH-20741)
Raymond Hettinger [Mon, 8 Jun 2020 19:38:41 +0000 (12:38 -0700)] 
Minor improvement to the namedtuple implementation (GH-20741)

* Cleaner way to build the arg list with a trailing comma when required

* Fix appearance of __new__ in help()

5 years agobpo-24914: mention Python supports multiple paradigms in the FAQ (#20658)
Brett Cannon [Mon, 8 Jun 2020 18:07:29 +0000 (11:07 -0700)] 
bpo-24914: mention Python supports multiple paradigms in the FAQ (#20658)

5 years agobpo-40854: PYTHONPLATLIBDIR env var added to 3.9 (GH-20735)
Victor Stinner [Mon, 8 Jun 2020 18:04:47 +0000 (20:04 +0200)] 
bpo-40854: PYTHONPLATLIBDIR env var added to 3.9 (GH-20735)

5 years agoAdd multicore support to deccheck.py. (GH-20731)
Stefan Krah [Mon, 8 Jun 2020 17:33:12 +0000 (19:33 +0200)] 
Add multicore support to deccheck.py. (GH-20731)

5 years agoRemove deleted libmpdec header from the Visual Studio build machinery. (GH-20730)
Stefan Krah [Mon, 8 Jun 2020 17:31:29 +0000 (19:31 +0200)] 
Remove deleted libmpdec header from the Visual Studio build machinery. (GH-20730)

5 years agobpo-40861: Enable optimizations when building liblzma (GH-20724)
Steve Dower [Mon, 8 Jun 2020 16:48:43 +0000 (17:48 +0100)] 
bpo-40861: Enable optimizations when building liblzma (GH-20724)

5 years agobpo-40910: Export Py_GetArgcArgv() function (GH-20721)
Victor Stinner [Mon, 8 Jun 2020 16:12:59 +0000 (18:12 +0200)] 
bpo-40910: Export Py_GetArgcArgv() function (GH-20721)

Export explicitly the Py_GetArgcArgv() function to the C API and
document the function. Previously, it was exported implicitly which
no longer works since Python is built with -fvisibility=hidden.

* Add PyConfig._orig_argv member.
* Py_InitializeFromConfig() no longer calls _PyConfig_Write() twice.
* PyConfig_Read() no longer initializes Py_GetArgcArgv(): it is now
  _PyConfig_Write() responsibility.
* _PyConfig_Write() result type becomes PyStatus instead of void.
* Write an unit test on Py_GetArgcArgv().

5 years agobpo-40854: Allow overriding sys.platlibdir via PYTHONPLATLIBDIR env-var (GH-20605)
Sandro Mani [Mon, 8 Jun 2020 15:28:11 +0000 (17:28 +0200)] 
bpo-40854: Allow overriding sys.platlibdir via PYTHONPLATLIBDIR env-var (GH-20605)

5 years agobpo-29882: Add _Py_popcount32() function (GH-20518)
Victor Stinner [Mon, 8 Jun 2020 14:30:33 +0000 (16:30 +0200)] 
bpo-29882: Add _Py_popcount32() function (GH-20518)

* Rename pycore_byteswap.h to pycore_bitutils.h.
* Move popcount_digit() to pycore_bitutils.h as _Py_popcount32().
* _Py_popcount32() uses GCC and clang builtin function if available.
* Add unit tests to _Py_popcount32().

5 years agobpo-33187: Document 3.9 changes to xml.etree.ElementInclude.include (GH-20438)
Shantanu [Mon, 8 Jun 2020 14:11:44 +0000 (07:11 -0700)] 
bpo-33187: Document 3.9 changes to xml.etree.ElementInclude.include (GH-20438)

Looks like the merging of bpo-33187 and bpo-20928 was racy, resulting in
this change going undocumented.

5 years agoallow macOS installer builds to package pre-built html docs (GH-20715)
Ned Deily [Mon, 8 Jun 2020 07:52:43 +0000 (03:52 -0400)] 
allow macOS installer builds to package pre-built html docs (GH-20715)

build-installer now looks in its directory of source tarballs
for a suitable html tarball of the same version.  If so, it
will unpack and use it rather than rebuilding the html format
documentation set from the source repo.  This is intended as
a speedup for test builds of the installer.  Files names must
be in the same format as produced by the docs build for download,
for example, `python-3.9.0b1-docs-html.tar.bz2`.

5 years agoDeny eval() direct access to builtins (GH-20713)
Raymond Hettinger [Mon, 8 Jun 2020 06:51:40 +0000 (23:51 -0700)] 
Deny eval() direct access to builtins (GH-20713)

5 years agobpo-22021: Update root_dir and base_dir documentation in shutil (GH-10367)
Lysandros Nikolaou [Mon, 8 Jun 2020 05:01:21 +0000 (08:01 +0300)] 
bpo-22021: Update root_dir and base_dir documentation in shutil (GH-10367)

Also added an example in shutil in order to make more clear how they are to be used.

Initially reported by Weinan Li on bpo.

5 years agobpo-40741: Update macOS installer to use SQLite 3.32.2. (GH-20705)
Ned Deily [Mon, 8 Jun 2020 02:24:33 +0000 (22:24 -0400)] 
bpo-40741: Update macOS installer to use SQLite 3.32.2. (GH-20705)

5 years agobpo-40903: Handle multiple '=' in invalid assignment rules in the PEG parser (GH...
Pablo Galindo [Mon, 8 Jun 2020 01:57:00 +0000 (02:57 +0100)] 
bpo-40903: Handle multiple '=' in invalid assignment rules in the PEG parser (GH-20697)

Automerge-Triggered-By: @pablogsal
5 years agobpo-39791 native hooks for importlib.resources.files (GH-20576)
Jason R. Coombs [Mon, 8 Jun 2020 01:00:51 +0000 (21:00 -0400)] 
bpo-39791 native hooks for importlib.resources.files (GH-20576)

* Provide native .files support on SourceFileLoader.

* Add native importlib.resources.files() support to zipimporter. Remove fallback support.

* make regen-all

* 📜🤖 Added by blurb_it.

* Move 'files' into the ResourceReader so it can carry the relevant module name context.

* Create 'importlib.readers' module and add FileReader to it.

* Add zip reader and rely on it for a TraversableResources object on zipimporter.

* Remove TraversableAdapter, no longer needed.

* Update blurb.

* Replace backslashes with forward slashes.

* Incorporate changes from importlib_metadata 2.0, finalizing the interface for extension via get_resource_reader.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
5 years agobpo-40904: Fix segfault in the new parser with f-string containing yield statements...
Pablo Galindo [Mon, 8 Jun 2020 00:47:37 +0000 (01:47 +0100)] 
bpo-40904: Fix segfault in the new parser with f-string containing yield statements with no value (GH-20701)

5 years agobpo-40887: Don't use finalized free lists (GH-20700)
Victor Stinner [Mon, 8 Jun 2020 00:14:47 +0000 (02:14 +0200)] 
bpo-40887: Don't use finalized free lists (GH-20700)

In debug mode, ensure that free lists are no longer used after being
finalized. Set numfree to -1 in finalization functions
(eg. _PyList_Fini()), and then check that numfree is not equal to -1
before using a free list (e.g list_dealloc()).

5 years agobpo-40881: Fix unicode_release_interned() (GH-20699)
Victor Stinner [Sun, 7 Jun 2020 23:39:47 +0000 (01:39 +0200)] 
bpo-40881: Fix unicode_release_interned() (GH-20699)

Use Py_SET_REFCNT() in unicode_release_interned().

5 years agobpo-40887: Fix finalize_interp_clear() for free lists (GH-20698)
Victor Stinner [Sun, 7 Jun 2020 23:22:36 +0000 (01:22 +0200)] 
bpo-40887: Fix finalize_interp_clear() for free lists (GH-20698)

Reorganize code to ensure that free lists are cleared in the right
order. Call _PyWarnings_Fini() before _PyList_Fini().

5 years agobpo-39791: Support file systems that cannot support non-ascii filenames (skipping...
Jason R. Coombs [Sun, 7 Jun 2020 14:57:45 +0000 (10:57 -0400)] 
bpo-39791: Support file systems that cannot support non-ascii filenames (skipping tests in that case). (#20681)

5 years agobpo-40898: Remove redundant if statements in tp_traverse (GH-20692)
Hai Shi [Sun, 7 Jun 2020 12:05:36 +0000 (20:05 +0800)] 
bpo-40898: Remove redundant if statements in tp_traverse (GH-20692)

5 years agoFix return type of test helper function heapctypewithbuffer_releasebuffer() (GH-20685)
Rémi Lapeyre [Sun, 7 Jun 2020 07:05:33 +0000 (09:05 +0200)] 
Fix return type of test helper function heapctypewithbuffer_releasebuffer() (GH-20685)

5 years agoUpdate comments to reflect the current API (GH-20682)
Raymond Hettinger [Sat, 6 Jun 2020 19:42:54 +0000 (12:42 -0700)] 
Update comments to reflect the current API (GH-20682)

5 years agobpo-40724: Support setting buffer slots from type specs (GH-20648)
scoder [Sat, 6 Jun 2020 19:35:10 +0000 (21:35 +0200)] 
bpo-40724: Support setting buffer slots from type specs (GH-20648)

This is not part of the limited API but makes the buffer slots available for type specs.

5 years agobpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)
Batuhan Taskaya [Sat, 6 Jun 2020 12:44:16 +0000 (15:44 +0300)] 
bpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)

5 years ago[workflow] Use gcc problem matcher for Ubuntu action build (GH-18567)
Ammar Askar [Sat, 6 Jun 2020 11:21:46 +0000 (11:21 +0000)] 
[workflow] Use gcc problem matcher for Ubuntu action build (GH-18567)

5 years agoRefactor scripts in Tools/peg_generator/scripts (GH-20401)
Lysandros Nikolaou [Sat, 6 Jun 2020 04:21:40 +0000 (07:21 +0300)] 
Refactor scripts in Tools/peg_generator/scripts (GH-20401)

5 years agobpo-40880: Fix invalid read in newline_in_string in pegen.c (#20666)
Pablo Galindo [Fri, 5 Jun 2020 23:52:27 +0000 (00:52 +0100)] 
bpo-40880: Fix invalid read in newline_in_string in pegen.c (#20666)

* bpo-40880: Fix invalid read in newline_in_string in pegen.c

* Update Parser/pegen/pegen.c

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* Add NEWS entry

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
5 years agobpo-40883: Fix memory leak in fstring_compile_expr in parse_string.c (GH-20667)
Pablo Galindo [Fri, 5 Jun 2020 23:52:15 +0000 (00:52 +0100)] 
bpo-40883: Fix memory leak in fstring_compile_expr in parse_string.c (GH-20667)

5 years agobpo-40862: Raise TypeError when const is given to argparse.BooleanOptionalAction...
Rémi Lapeyre [Fri, 5 Jun 2020 22:00:42 +0000 (00:00 +0200)] 
bpo-40862: Raise TypeError when const is given to argparse.BooleanOptionalAction (GH-20623)

5 years agobpo-40867: Remove unused include from Module/_randommodule.c (GH-20635)
Erlend Egeberg Aasland [Fri, 5 Jun 2020 21:32:09 +0000 (23:32 +0200)] 
bpo-40867: Remove unused include from Module/_randommodule.c (GH-20635)

5 years agobpo-40876: Clarify error message in the csv module (GH-20653)
Ram Rachum [Fri, 5 Jun 2020 20:56:06 +0000 (23:56 +0300)] 
bpo-40876: Clarify error message in the csv module (GH-20653)

5 years agobpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659)
Jason R. Coombs [Fri, 5 Jun 2020 20:34:16 +0000 (16:34 -0400)] 
bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659)

* Refresh importlib.metadata from importlib_metadata 1.6.1.

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
5 years agoFix missing FloatOperation in EXTRA_FUNCTIONALITY path. (#20655)
Stefan Krah [Fri, 5 Jun 2020 20:01:18 +0000 (22:01 +0200)] 
Fix missing FloatOperation in EXTRA_FUNCTIONALITY path. (#20655)

5 years agobpo-19468: delete unnecessary instance check in importlib.reload() (GH-19424)
Furkan Önder [Fri, 5 Jun 2020 19:56:32 +0000 (22:56 +0300)] 
bpo-19468: delete unnecessary instance check in importlib.reload() (GH-19424)

Automerge-Triggered-By: @brettcannon
5 years agobpo-40874: Update to libmpdec-2.5.0 (GH-20652)
Stefan Krah [Fri, 5 Jun 2020 17:43:01 +0000 (19:43 +0200)] 
bpo-40874: Update to libmpdec-2.5.0 (GH-20652)

5 years agobpo-1635741: Port mmap module to multiphase initialization (GH-19459)
Dong-hee Na [Fri, 5 Jun 2020 15:01:02 +0000 (00:01 +0900)] 
bpo-1635741: Port mmap module to multiphase initialization (GH-19459)

5 years agobpo-40521: Make context free list per-interpreter (GH-20644)
Victor Stinner [Fri, 5 Jun 2020 00:56:37 +0000 (02:56 +0200)] 
bpo-40521: Make context free list per-interpreter (GH-20644)

Each interpreter now has its own context free list:

* Move context free list into PyInterpreterState.
* Add _Py_context_state structure.
* Add tstate parameter to _PyContext_ClearFreeList()
  and _PyContext_Fini().
* Pass tstate to clear_freelists().

5 years agobpo-40521: Make async gen free lists per-interpreter (GH-20643)
Victor Stinner [Fri, 5 Jun 2020 00:34:14 +0000 (02:34 +0200)] 
bpo-40521: Make async gen free lists per-interpreter (GH-20643)

Each interpreter now has its own asynchronous generator free lists:

* Move async gen free lists into PyInterpreterState.
* Move _PyAsyncGen_MAXFREELIST define to pycore_interp.h
* Add _Py_async_gen_state structure.
* Add tstate parameter to _PyAsyncGen_ClearFreeLists
  and _PyAsyncGen_Fini().

5 years agobpo-40521: Make list free list per-interpreter (GH-20642)
Victor Stinner [Fri, 5 Jun 2020 00:05:41 +0000 (02:05 +0200)] 
bpo-40521: Make list free list per-interpreter (GH-20642)

Each interpreter now has its own list free list:

* Move list numfree and free_list into PyInterpreterState.
* Add _Py_list_state structure.
* Add tstate parameter to _PyList_ClearFreeList()
  and _PyList_Fini().
* Remove "#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS".
* _PyGC_Fini() clears gcstate->garbage list which can be stored in
  the list free list. Call _PyGC_Fini() before _PyList_Fini() to
  prevent leaking this list.

5 years agobpo-40807: Show warnings once from codeop._maybe_compile (#20486)
Cheryl Sabella [Thu, 4 Jun 2020 23:40:24 +0000 (19:40 -0400)] 
bpo-40807: Show warnings once from codeop._maybe_compile (#20486)

* bpo-40807: Show warnings once from codeop._maybe_compile

* Move catch_warnings

* news

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agobpo-40521: Make frame free list per-interpreter (GH-20638)
Victor Stinner [Thu, 4 Jun 2020 23:39:24 +0000 (01:39 +0200)] 
bpo-40521: Make frame free list per-interpreter (GH-20638)

Each interpreter now has its own frame free list:

* Move frame free list into PyInterpreterState.
* Add _Py_frame_state structure.
* Add tstate parameter to _PyFrame_ClearFreeList()
  and _PyFrame_Fini().
* Remove "#if PyFrame_MAXFREELIST > 0".
* Remove "#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS".

5 years agobpo-40521: Make slice cache per-interpreter (GH-20637)
Victor Stinner [Thu, 4 Jun 2020 23:14:40 +0000 (01:14 +0200)] 
bpo-40521: Make slice cache per-interpreter (GH-20637)

Each interpreter now has its own slice cache:

* Move slice cache into PyInterpreterState.
* Add tstate parameter to _PySlice_Fini().

5 years agobpo-40521: Make float free list per-interpreter (GH-20636)
Victor Stinner [Thu, 4 Jun 2020 22:50:05 +0000 (00:50 +0200)] 
bpo-40521: Make float free list per-interpreter (GH-20636)

Each interpreter now has its own float free list:

* Move tuple numfree and free_list into PyInterpreterState.
* Add _Py_float_state structure.
* Add tstate parameter to _PyFloat_ClearFreeList()
  and _PyFloat_Fini().

5 years agobpo-40521: Make tuple free list per-interpreter (GH-20247)
Victor Stinner [Thu, 4 Jun 2020 21:38:36 +0000 (23:38 +0200)] 
bpo-40521: Make tuple free list per-interpreter (GH-20247)

Each interpreter now has its own tuple free lists:

* Move tuple numfree and free_list arrays into PyInterpreterState.
* Define PyTuple_MAXSAVESIZE and PyTuple_MAXFREELIST macros in
  pycore_interp.h.
* Add _Py_tuple_state structure. Pass it explicitly to tuple_alloc().
* Add tstate parameter to _PyTuple_ClearFreeList()
* Each interpreter now has its own empty tuple singleton.

5 years agobpo-39573: Porting to Python 3.10: Py_SET_SIZE() macro (GH-20610)
Victor Stinner [Thu, 4 Jun 2020 20:10:43 +0000 (22:10 +0200)] 
bpo-39573: Porting to Python 3.10: Py_SET_SIZE() macro (GH-20610)

In What's New in Python 3.10, propose Py_SET_SIZE(), Py_SET_REFCNT()
and Py_SET_TYPE() macros for backward compatibility with Python 3.9
and older.

5 years agobpo-40865: Remove unused insint() macro from hash modules (GH-20627)
Erlend Egeberg Aasland [Thu, 4 Jun 2020 20:08:42 +0000 (22:08 +0200)] 
bpo-40865: Remove unused insint() macro from hash modules (GH-20627)

Automerge-Triggered-By: @tiran
5 years agoFix spacing in docs for tarfile (GH-20629)
Harsha Laxman [Thu, 4 Jun 2020 19:58:10 +0000 (12:58 -0700)] 
Fix spacing in docs for tarfile (GH-20629)

Before
```
content.txt is 42 bytes in size and isa regular file.
folder is 420 bytes in size and isa directory.
magic is 4200 bytes in size and issomething else.
```

After:
```
content.txt is 42 bytes in size and is a regular file.
folder is 420 bytes in size and is a directory.
magic is 4200 bytes in size and is something else.
```

Automerge-Triggered-By: @orsenthil
5 years agobpo-40679: Fix _PyEval_EvalCode() crash if qualname is NULL (GH-20615)
Victor Stinner [Thu, 4 Jun 2020 13:19:02 +0000 (15:19 +0200)] 
bpo-40679: Fix _PyEval_EvalCode() crash if qualname is NULL (GH-20615)

If name is NULL, name is now set to co->co_name.
If qualname is NULL, qualname is now set to name.

qualname must not be NULL: it is used to build error messages.

Cleanup also the code: declare variables where they are initialized.
Rename "name" local variables to "varname" to avoid overriding "name"
parameter.

5 years agobpo-17258: Add requires_hashdigest to multiprocessing tests (GH-20412)
Christian Heimes [Thu, 4 Jun 2020 12:48:17 +0000 (14:48 +0200)] 
bpo-17258: Add requires_hashdigest to multiprocessing tests (GH-20412)

Skip some :mod:`multiprocessing` tests when MD5 hash digest is blocked.

Signed-off-by: Christian Heimes <christian@python.org>
5 years agoDon't raise an exception on normal return from generator. (GH-19473)
Mark Shannon [Thu, 4 Jun 2020 12:23:35 +0000 (13:23 +0100)] 
Don't raise an exception on normal return from generator. (GH-19473)

5 years agoFix MSVC warning in frameobject.c (GH-20590)
Ammar Askar [Thu, 4 Jun 2020 05:19:23 +0000 (05:19 +0000)] 
Fix MSVC warning in frameobject.c (GH-20590)

5 years agoRemove unused ReaderObject_Check macro (#20614)
Dong-hee Na [Wed, 3 Jun 2020 15:43:46 +0000 (00:43 +0900)] 
Remove unused ReaderObject_Check macro (#20614)

5 years agoUpdate error message in _zoneinfo.py to use f-string (GH-20577)
aboddie [Wed, 3 Jun 2020 14:18:19 +0000 (10:18 -0400)] 
Update error message in _zoneinfo.py to use f-string (GH-20577)

Inline with the rest of the file, updated error message to use f-string.

5 years agobpo-40471: Fix grammar typo in 'issubclass' docstring (GH-19847)
Alex Povel [Wed, 3 Jun 2020 13:19:45 +0000 (15:19 +0200)] 
bpo-40471: Fix grammar typo in 'issubclass' docstring (GH-19847)

Just a brief grammar fix.

See also <>.

5 years agobpo-40767: Allow pure Wayland to get default XDG web browser (GH-20382)
Jeremy Attali [Wed, 3 Jun 2020 12:42:33 +0000 (08:42 -0400)] 
bpo-40767: Allow pure Wayland to get default XDG web browser (GH-20382)

Would be nice to backport to python 3.7+. I don't think it's worth the hassle to backport this all the way down to 3.10. But I'll let the maintainers decide.

This is hard to test because the test setup already includes this [environment variable](https://github.com/python/cpython/blob/master/Lib/test/pythoninfo.py#L292)

Let me know if something doesn't match the PR guidelines. This is my first PR in the python source code.

5 years agobpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)
Victor Stinner [Wed, 3 Jun 2020 12:39:59 +0000 (14:39 +0200)] 
bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)

my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for
pending signals, rather calling PyOS_InterruptOccurred().

my_fgets() is called with the GIL released, whereas
PyOS_InterruptOccurred() must be called with the GIL held.

test_repl: use text=True and avoid SuppressCrashReport in
test_multiline_string_parsing().

Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.

5 years agobpo-32604: Fix reference leak in select module (GH-20600)
Victor Stinner [Wed, 3 Jun 2020 12:36:46 +0000 (14:36 +0200)] 
bpo-32604: Fix reference leak in select module (GH-20600)

Fix reference leak in PyInit_select() of the select module:
remove Py_INCREF(poll_Type).

5 years agoPyOS_AfterFork_Child() pass tstate to _PyEval_ReInitThreads() (GH-20598)
Victor Stinner [Tue, 2 Jun 2020 16:44:54 +0000 (18:44 +0200)] 
PyOS_AfterFork_Child() pass tstate to _PyEval_ReInitThreads() (GH-20598)

5 years agobpo-40232: _PyImport_ReInitLock() can now safely use its lock (GH-20597)
Victor Stinner [Tue, 2 Jun 2020 15:13:49 +0000 (17:13 +0200)] 
bpo-40232: _PyImport_ReInitLock() can now safely use its lock (GH-20597)

Since _PyImport_ReInitLock() now calls _PyThread_at_fork_reinit() on
the import lock, the lock is now in a known state: unlocked. It
became safe to acquire it after fork.

5 years agoPyOS_AfterFork_Child() uses PyStatus (GH-20596)
Victor Stinner [Tue, 2 Jun 2020 13:51:37 +0000 (15:51 +0200)] 
PyOS_AfterFork_Child() uses PyStatus (GH-20596)

PyOS_AfterFork_Child() helper functions now return a PyStatus:
PyOS_AfterFork_Child() is now responsible to handle errors.

* Move _PySignal_AfterFork() to the internal C API
* Add #ifdef HAVE_FORK on _PyGILState_Reinit(), _PySignal_AfterFork()
  and _PyInterpreterState_DeleteExceptMain().

5 years agobpo-39465: Cleanup _PyUnicode_FromId() code (GH-20595)
Victor Stinner [Tue, 2 Jun 2020 12:39:45 +0000 (14:39 +0200)] 
bpo-39465: Cleanup _PyUnicode_FromId() code (GH-20595)

Work on a local variable before filling _Py_Identifier members.

5 years agobpo-40839: PyDict_GetItem() requires the GIL (GH-20580)
Victor Stinner [Tue, 2 Jun 2020 12:03:25 +0000 (14:03 +0200)] 
bpo-40839: PyDict_GetItem() requires the GIL (GH-20580)

Calling PyDict_GetItem() without GIL held had been allowed for
historical reason. It is no longer allowed.

5 years agobpo-35078: Allow customization of CSS class name of a month in calendar module (gh...
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) [Tue, 2 Jun 2020 11:33:09 +0000 (17:03 +0530)] 
bpo-35078: Allow customization of CSS class name of a month in calendar module (gh-10137)

Refactor formatweekday(), formatmonthname() methods in LocaleHTMLCalendar and LocaleTextCalendar classes in calendar module to call the base class methods. This enables customizable CSS classes for LocaleHTMLCalendar and LocaleTextCalendar.

Patch by Srinivas Reddy Thatiparthy

5 years agobpo-40241: What's New in Python 3.9: opaque PyGC_Head (GH-20586)
Victor Stinner [Tue, 2 Jun 2020 10:02:58 +0000 (12:02 +0200)] 
bpo-40241: What's New in Python 3.9: opaque PyGC_Head (GH-20586)

5 years agobpo-40244: Remove XLC's support from the noreturn flag (GH-20588)
Batuhan Taskaya [Tue, 2 Jun 2020 08:19:52 +0000 (11:19 +0300)] 
bpo-40244: Remove XLC's support from the noreturn flag (GH-20588)

Automerge-Triggered-By: @pablogsal
5 years agoFix MSVC warnings in pythonrun.c (#GH-0587)
Ammar Askar [Tue, 2 Jun 2020 08:17:24 +0000 (08:17 +0000)] 
Fix MSVC warnings in pythonrun.c (#GH-0587)

5 years agobpo-26543: Fix IMAP4.noop when debug mode is enabled (GH-15206)
Sanyam Khurana [Tue, 2 Jun 2020 01:17:45 +0000 (06:47 +0530)] 
bpo-26543: Fix IMAP4.noop when debug mode is enabled (GH-15206)

5 years agoEnsure correct version of Sphinx is used for Windows builds (GH-20582)
Steve Dower [Mon, 1 Jun 2020 21:17:23 +0000 (22:17 +0100)] 
Ensure correct version of Sphinx is used for Windows builds (GH-20582)

5 years agobpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)
Victor Stinner [Mon, 1 Jun 2020 18:59:35 +0000 (20:59 +0200)] 
bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)

Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception.

Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup
these functions.

5 years agobpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h (GH-18413)
Skip Montanaro [Mon, 1 Jun 2020 18:35:56 +0000 (13:35 -0500)] 
bpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h (GH-18413)

5 years agobpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)
Victor Stinner [Mon, 1 Jun 2020 18:34:15 +0000 (20:34 +0200)] 
bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)

PyOS_InterruptOccurred() now fails with a fatal error if it is called
with the GIL released.

5 years agobpo-40630: adjust tracemalloc.reset_peak docs for backport to 3.9 (GH-20546)
Huon Wilson [Mon, 1 Jun 2020 17:26:33 +0000 (03:26 +1000)] 
bpo-40630: adjust tracemalloc.reset_peak docs for backport to 3.9 (GH-20546)

5 years agobpo-39943: Fix MSVC warnings in sre extension (GH-20508)
Ammar Askar [Mon, 1 Jun 2020 17:21:43 +0000 (17:21 +0000)] 
bpo-39943: Fix MSVC warnings in sre extension (GH-20508)

5 years agobpo-39593: Add test on ctypes cfield.c s_set() (GH-18424)
Hai Shi [Mon, 1 Jun 2020 16:54:18 +0000 (00:54 +0800)] 
bpo-39593: Add test on ctypes cfield.c s_set() (GH-18424)

5 years agobpo-1635741: Port fcntl module to multiphase initialization (GH-20540)
Dong-hee Na [Mon, 1 Jun 2020 16:12:24 +0000 (01:12 +0900)] 
bpo-1635741: Port fcntl module to multiphase initialization (GH-20540)

5 years agobpo-40831: Remove an incorrect statement in the Windows docs (GH-20570)
Zackery Spytz [Mon, 1 Jun 2020 15:43:56 +0000 (09:43 -0600)] 
bpo-40831: Remove an incorrect statement in the Windows docs (GH-20570)

5 years agobpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)
Victor Stinner [Mon, 1 Jun 2020 14:02:40 +0000 (16:02 +0200)] 
bpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)

Add _Py_EnsureTstateNotNULL(tstate) macro: call Py_FatalError() if
tstate is NULL, the error message contains the current function name.

5 years agoMake sure that keyword arguments are merged into the arguments dictionary when dict...
Mark Shannon [Mon, 1 Jun 2020 09:42:42 +0000 (10:42 +0100)] 
Make sure that keyword arguments are merged into the arguments dictionary when dict unpacking and keyword arguments are interleaved. (GH-20553)

5 years agobpo-30008: Fix OpenSSL no-deprecated compilation (GH-20397)
Christian Heimes [Mon, 1 Jun 2020 06:58:14 +0000 (08:58 +0200)] 
bpo-30008: Fix OpenSSL no-deprecated compilation (GH-20397)

Fix :mod:`ssl`` code to be compatible with OpenSSL 1.1.x builds that use
``no-deprecated`` and ``--api=1.1.0``.

Note: Tests assume full OpenSSL API and fail with limited API.

Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Mark Wright <gienah@gentoo.org>
5 years agobpo-17005: Move topological sort functionality to its own module (GH-20558)
Pablo Galindo [Sun, 31 May 2020 23:41:14 +0000 (00:41 +0100)] 
bpo-17005: Move topological sort functionality to its own module (GH-20558)

The topological sort functionality that was introduced initially in the
functools module has been moved to a new graphlib module to
better accommodate the new tools and keep the original scope of the
functools module.

5 years agoFix typo in "What's new in Python 3.9" (GH-20559)
Lysandros Nikolaou [Sun, 31 May 2020 23:28:46 +0000 (02:28 +0300)] 
Fix typo in "What's new in Python 3.9" (GH-20559)

Automerge-Triggered-By: @pablogsal
5 years agobpo-40759: Deprecate the symbol module (GH-20364)
Batuhan Taskaya [Sun, 31 May 2020 22:01:50 +0000 (01:01 +0300)] 
bpo-40759: Deprecate the symbol module (GH-20364)

Automerge-Triggered-By: @pablogsal
5 years agobpo-40755: Add rich comparisons to Counter (GH-20548)
Raymond Hettinger [Sun, 31 May 2020 21:57:42 +0000 (14:57 -0700)] 
bpo-40755: Add rich comparisons to Counter (GH-20548)

5 years agoFix asyncio.to_thread() documented return type (GH-20547)
Kyle Stanley [Sun, 31 May 2020 07:07:04 +0000 (03:07 -0400)] 
Fix asyncio.to_thread() documented return type (GH-20547)

When I wrote the documentation for `asyncio.to_thread()`, I mistakenly assumed that `return await loop.run_in_executor(...)` within an async def function would return a Future. In reality, it returns a coroutine.

This likely won't affect typical usage of `asyncio.to_thread()`, but it's important for the documentation to be correct here. In general, we also tend to avoid returning futures from high-level APIs in asyncio.

5 years agobpo-40829: Add a what's new entry about deprecation of shuffle's random parameter...
Batuhan Taskaya [Sat, 30 May 2020 22:15:06 +0000 (01:15 +0300)] 
bpo-40829: Add a what's new entry about deprecation of shuffle's random parameter (GH-20541)

5 years agobpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748)
Zackery Spytz [Sat, 30 May 2020 08:22:02 +0000 (02:22 -0600)] 
bpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748)

tup should be decrefed in the unlikely event of a PyList_New()
failure.

5 years agobpo-40798: Generate a different message for already removed elements (GH-20483)
Florian Dahlitz [Sat, 30 May 2020 07:47:32 +0000 (09:47 +0200)] 
bpo-40798: Generate a different message for already removed elements (GH-20483)

5 years agocloses bpo-29017: Update the bindings for Qt information with PySide2 (GH-20149)
Samuel Gaist [Sat, 30 May 2020 01:57:03 +0000 (03:57 +0200)] 
closes bpo-29017: Update the bindings for Qt information with PySide2 (GH-20149)

Reference to PySide has been removed has it is for Qt 4, which has reached end of life.