]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agobpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)
Miss Islington (bot) [Thu, 21 May 2020 05:38:00 +0000 (22:38 -0700)] 
bpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)

Allows contextvars from the main thread to be accessed in the separate thread used in `asyncio.to_thread()`. See the [discussion](https://github.com/python/cpython/pull/20143GH-discussion_r427808225) in GH-20143 for context.

Automerge-Triggered-By: @aeros
(cherry picked from commit 0f56263e62ba91d0baae40fb98947a3a98034a73)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
5 years agoUpdate whatsnew benchmark results for 3.9 (GH-20276) (GH-20277)
Miss Islington (bot) [Thu, 21 May 2020 02:11:28 +0000 (19:11 -0700)] 
Update whatsnew benchmark results for 3.9 (GH-20276) (GH-20277)

5 years agos/wakup/wakeup (GH-20250)
Miss Islington (bot) [Wed, 20 May 2020 17:58:47 +0000 (10:58 -0700)] 
s/wakup/wakeup (GH-20250)

(as title)

Automerge-Triggered-By: @Mariatta
(cherry picked from commit f2947e354c95d246b1836ac78d4c820c420e259b)

Co-authored-by: Kunal Bhalla <bhalla.kunal@gmail.com>
5 years agoUse v2 of GitHub Actions where available (GH-20232)
Miss Islington (bot) [Wed, 20 May 2020 16:59:25 +0000 (09:59 -0700)] 
Use v2 of GitHub Actions where available (GH-20232)

Automerge-Triggered-By: @Mariatta
(cherry picked from commit 7fbe65dbc42985d002d9538fe9a9887e6e6af66c)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
5 years agobpo-40698: Improve distutils upload hash digests (GH-20260)
Miss Islington (bot) [Wed, 20 May 2020 14:57:08 +0000 (07:57 -0700)] 
bpo-40698: Improve distutils upload hash digests (GH-20260)

- Fix upload test on systems that blocks MD5
- Add SHA2-256 and Blake2b-256 digests based on new Warehous and twine
  specs.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit e572c7f6dbe5397153803eab256e4a4ca3384f80)

Co-authored-by: Christian Heimes <christian@python.org>
5 years agobpo-34956: edit and format better NEWS item in 3.9.0b1 changelog (GH-20255)
Miss Islington (bot) [Wed, 20 May 2020 09:47:07 +0000 (02:47 -0700)] 
bpo-34956: edit and format better NEWS item in 3.9.0b1 changelog (GH-20255)

(cherry picked from commit bac170cd93bbae939fcb29ccc6b5d423f7f4a089)

Co-authored-by: Ned Deily <nad@python.org>
5 years agobpo-40291: Mention socket.CAN_J1939 in What's New (GH-20248)
Miss Islington (bot) [Wed, 20 May 2020 02:37:17 +0000 (19:37 -0700)] 
bpo-40291: Mention socket.CAN_J1939 in What's New (GH-20248)

This mentions the new CAN_J1939 implementation in the What's New
documentation for Python 3.9

Automerge-Triggered-By: @gvanrossum
(cherry picked from commit 550f30c8f33a2ba844db2ce3da8a897b3e882c9a)

Co-authored-by: karl ding <karlding@users.noreply.github.com>
5 years agobpo-40645: restrict HMAC key len to INT_MAX (GH-20238)
Miss Islington (bot) [Tue, 19 May 2020 22:52:54 +0000 (15:52 -0700)] 
bpo-40645: restrict HMAC key len to INT_MAX (GH-20238)

Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: @tiran
(cherry picked from commit aca4670ad695d4b01c7880fe3d0af817421945bd)

Co-authored-by: Christian Heimes <christian@python.org>
5 years agobpo-38870: invalid escape sequence (GH-20240)
Miss Islington (bot) [Tue, 19 May 2020 22:33:45 +0000 (15:33 -0700)] 
bpo-38870: invalid escape sequence (GH-20240)

`/home/isidentical/cpython/cpython/Lib/test/test_unparse.py:333: DeprecationWarning: invalid escape sequence \X`

Automerge-Triggered-By: @pablogsal
(cherry picked from commit dd74b6fde31aff9aa46c4fc2a830c569764e1b63)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
5 years ago[3.9] bpo-40514: Remove --with-experimental-isolated-subinterpreters in 3.9 (GH-20228)
Victor Stinner [Tue, 19 May 2020 22:27:46 +0000 (00:27 +0200)] 
[3.9] bpo-40514: Remove --with-experimental-isolated-subinterpreters in 3.9 (GH-20228)

Remove --with-experimental-isolated-subinterpreters configure option
in Python 3.9: the experiment continues in the master branch, but
it's no longer needed in 3.9.

5 years agoEnable GitHub Actions for 3.9 branch (GH-20231)
Miss Islington (bot) [Tue, 19 May 2020 17:24:52 +0000 (10:24 -0700)] 
Enable GitHub Actions for 3.9 branch (GH-20231)

(cherry picked from commit c105f7d8955ef9bf51125f6e44e8543e5f0618df)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
5 years agobpo-40683: Add zoneinfo to LIBSUBDIRS (GH-20229)
Miss Islington (bot) [Tue, 19 May 2020 16:13:15 +0000 (09:13 -0700)] 
bpo-40683: Add zoneinfo to LIBSUBDIRS (GH-20229)

Without this, only the _zoneinfo module is getting installed, not the
zoneinfo module. I believe this was not noticed earlier because
test.test_zoneinfo was also not being installed.
(cherry picked from commit 2abededbc4165d2daa14ae9d74b1f33cce0593d7)

Co-authored-by: Paul Ganssle <paul@ganssle.io>
5 years agoFix code-block in zoneinfo (GH-20201)
Miss Islington (bot) [Tue, 19 May 2020 14:02:32 +0000 (07:02 -0700)] 
Fix code-block in zoneinfo (GH-20201)

```
Warning, treated as error:
/tmp/code/Doc/library/zoneinfo.rst:303:Error in "code-block" directive:
1 argument(s) required, 0 supplied.

.. code-block::

    >>> a = ZoneInfo("Europe/Berlin")
    >>> b = pickle.loads(europe_berlin_pkl)
    >>> a is b
    True
```
(cherry picked from commit 9095f76613c8dd67beb21992def837bb8a37ed25)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
5 years agobpo-40677: Define IO_REPARSE_TAG_APPEXECLINK explicitly (GH-20206)
Miss Islington (bot) [Tue, 19 May 2020 12:40:21 +0000 (05:40 -0700)] 
bpo-40677: Define IO_REPARSE_TAG_APPEXECLINK explicitly (GH-20206)

This allows building with older versions of the Windows SDK where the value is not defined.
(cherry picked from commit 711f9e180a48baba62301735b7f1a58ef0d0e93a)

Co-authored-by: Minmin Gong <gongminmin@msn.com>
5 years agobpo-39631: Fix file association MIME type in the Windows installer (GH-20205)
Miss Islington (bot) [Tue, 19 May 2020 12:39:16 +0000 (05:39 -0700)] 
bpo-39631: Fix file association MIME type in the Windows installer (GH-20205)

Use text/x-python instead of text/plain to avoid issues with tools assuming that "ShellExecute(script)" is a non-executable operation.
(cherry picked from commit 8c862e51248c5ebfec787badec88eb58c9267e1e)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
5 years ago[3.9] Doc: Python 3.10 in sidebar and version switcher. (GH-20209) (GH-20221)
Miss Islington (bot) [Tue, 19 May 2020 12:31:57 +0000 (05:31 -0700)] 
[3.9] Doc: Python 3.10 in sidebar and version switcher. (GH-20209) (GH-20221)

(cherry picked from commit 19e3e0026417caa92ffe21a67157363b45da9aa2)

Co-authored-by: Julien Palard <julien@palard.fr>
5 years agobpo-32309: Implement asyncio.to_thread() (GH-20143)
Miss Islington (bot) [Tue, 19 May 2020 10:03:25 +0000 (03:03 -0700)] 
bpo-32309: Implement asyncio.to_thread() (GH-20143)

Implements `asyncio.to_thread`, a coroutine for asynchronously running IO-bound functions in a separate thread without blocking the event loop. See the discussion starting from [here](https://github.com/python/cpython/pull/18410GH-issuecomment-628930973) in GH-18410 for context.

Automerge-Triggered-By: @aeros
(cherry picked from commit cc2bbc2227c3f5ed9d8f6b3bd052e6f9e68279d2)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
5 years agobpo-40669: Use requirements.pip when installing PEG dependencies (GH-20194)
Miss Islington (bot) [Tue, 19 May 2020 02:31:28 +0000 (19:31 -0700)] 
bpo-40669: Use requirements.pip when installing PEG dependencies (GH-20194)

(cherry picked from commit 3764069f3ba2a7e932837ae19265059339dc86e3)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agoUse _PyErr_ChainStackItem() inside gen_send_ex(). (GH-20173) (#20202)
Miss Islington (bot) [Tue, 19 May 2020 02:14:13 +0000 (19:14 -0700)] 
Use _PyErr_ChainStackItem() inside gen_send_ex(). (GH-20173) (#20202)

_PyErr_ChainStackItem was just added in GH-19951 (for bpo-31033).
(cherry picked from commit ff7a8b03c49153021d6de5d0b2fa8b5163059ed6)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
5 years agoUpdate README links to point to 3.9 and not master
Łukasz Langa [Tue, 19 May 2020 00:31:31 +0000 (02:31 +0200)] 
Update README links to point to 3.9 and not master

5 years agoPost 3.9.0b1
Łukasz Langa [Tue, 19 May 2020 00:12:30 +0000 (02:12 +0200)] 
Post 3.9.0b1

5 years agoPython 3.9.0b1 v3.9.0b1
Łukasz Langa [Mon, 18 May 2020 23:07:09 +0000 (01:07 +0200)] 
Python 3.9.0b1

5 years agobpo-40275: More lazy imports in test.support (GH-20131)
Hai Shi [Mon, 18 May 2020 22:02:57 +0000 (06:02 +0800)] 
bpo-40275: More lazy imports in test.support (GH-20131)

Make the the following imports lazy in test.support:

* bz2
* gzip
* lzma
* resource
* zlib

The following test.support decorators now need to be called
with parenthesis:

* @support.requires_bz2
* @support.requires_gzip
* @support.requires_lzma
* @support.requires_zlib

For example, "@requires_zlib" becomes "@requires_zlib()".

5 years agoRegenerate the parser (#20195)
Pablo Galindo [Mon, 18 May 2020 21:47:51 +0000 (22:47 +0100)] 
Regenerate the parser (#20195)

5 years agobpo-38870: Don't omit parenthesis when unparsing a slice in ast.unparse
Batuhan Taskaya [Mon, 18 May 2020 20:48:49 +0000 (23:48 +0300)] 
bpo-38870: Don't omit parenthesis when unparsing a slice in ast.unparse

When unparsing a non-empty tuple, the parentheses can be safely
omitted if there aren't any elements that explicitly require them (such as starred expressions).

5 years agobpo-40334: Reproduce error message for type comments on bare '*' in the new parser...
Lysandros Nikolaou [Mon, 18 May 2020 19:14:47 +0000 (22:14 +0300)] 
bpo-40334: Reproduce error message for type comments on bare '*' in the new parser (GH-20151)

5 years agobpo-38870: correctly escape unprintable characters on ast.unparse (GH-20166)
CyberSaxosTiGER [Mon, 18 May 2020 18:41:35 +0000 (21:41 +0300)] 
bpo-38870: correctly escape unprintable characters on ast.unparse (GH-20166)

Unprintable characters such as `\x00` weren't correctly roundtripped
due to not using default string repr when generating docstrings. This
patch correctly encodes all unprintable characters (except `\n` and `\t`, which
are commonly used for formatting, and found unescaped).

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
5 years agobpo-40669: Install PEG benchmarking dependencies in a venv (GH-20183)
Lysandros Nikolaou [Mon, 18 May 2020 18:27:40 +0000 (21:27 +0300)] 
bpo-40669: Install PEG benchmarking dependencies in a venv (GH-20183)

Create a `make venv` target, that creates a virtual environment
and installs the dependency in that venv. `make time` and all
the related targets are changed to use the virtual environment
python.

Automerge-Triggered-By: @pablogsal
5 years agobpo-40663: Correctly handle annotations with subscripts in ast_unparse.c (GH-20156)
Batuhan Taskaya [Mon, 18 May 2020 18:23:48 +0000 (21:23 +0300)] 
bpo-40663: Correctly handle annotations with subscripts in ast_unparse.c (GH-20156)

5 years agobpo-40662: Fixed ast.get_source_segment for ast nodes that have incomplete location...
Irit Katriel [Mon, 18 May 2020 18:14:12 +0000 (19:14 +0100)] 
bpo-40662: Fixed ast.get_source_segment for ast nodes that have incomplete location information (GH-20157)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agobpo-40528: Improve AST generation script to do builds simultaneously (GH-19968)
Batuhan Taskaya [Mon, 18 May 2020 17:42:10 +0000 (20:42 +0300)] 
bpo-40528: Improve AST generation script to do builds simultaneously (GH-19968)

- Switch from getopt to argparse.
- Removed the limitation of not being able to produce both C and H simultaneously.

This will make it run faster since it parses the asdl definition once and uses the generated tree to generate both the header and the C source.

5 years agobpo-40661: Fix segfault when parsing invalid input (GH-20165)
Lysandros Nikolaou [Mon, 18 May 2020 17:32:03 +0000 (20:32 +0300)] 
bpo-40661: Fix segfault when parsing invalid input (GH-20165)

Fix segfaults when parsing very complex invalid input, like `import äˆ ð£„¯ð¢·žð±‹á”€ð””ð‘©±å®ä±¬ð©¾\nð—¶½`.

Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
5 years agobpo-40257: Revert changes to inspect.getdoc() (GH-20073)
Serhiy Storchaka [Mon, 18 May 2020 17:25:07 +0000 (20:25 +0300)] 
bpo-40257: Revert changes to inspect.getdoc() (GH-20073)

5 years agobpo-35890: Use RegQueryInfoKeyW and CryptAcquireContextW explicitly (GH-19974)
Minmin Gong [Mon, 18 May 2020 16:50:03 +0000 (09:50 -0700)] 
bpo-35890: Use RegQueryInfoKeyW and CryptAcquireContextW explicitly (GH-19974)

5 years agobpo-40650: Include winsock2.h in pytime.c, instead of a full windows.h (GH-20137)
Minmin Gong [Mon, 18 May 2020 16:22:53 +0000 (09:22 -0700)] 
bpo-40650: Include winsock2.h in pytime.c, instead of a full windows.h (GH-20137)

5 years agobpo-40653: Move _dirnameW out of #ifdef HAVE_SYMLINK/#endif (GH-20144)
Minmin Gong [Mon, 18 May 2020 16:17:19 +0000 (09:17 -0700)] 
bpo-40653: Move _dirnameW out of #ifdef HAVE_SYMLINK/#endif (GH-20144)

5 years agoRevert "bpo-26317: Support OBJC and OBJCXX configure command line variables (GH-20176...
Ned Deily [Mon, 18 May 2020 15:31:21 +0000 (11:31 -0400)] 
Revert "bpo-26317: Support OBJC and OBJCXX configure command line variables (GH-20176)" (GH-20182)

This reverts commit 0da546665075aefbb476e192ed64122d340164f4.

The commit is causing make failures on a FreeBSD buildbot.
Due to the imminent 3.9.0b1 cutoff, revert this commit for
now pending further investigation.

5 years agobpo-38112: Document that compileall.compile_[dir,file] also accept multiple opt level...
Lumír 'Frenzy' Balhar [Mon, 18 May 2020 13:23:37 +0000 (15:23 +0200)] 
bpo-38112: Document that compileall.compile_[dir,file] also accept multiple opt levels (GH-20174)

5 years agobpo-26317: Support OBJC and OBJCXX configure command line variables (GH-20176)
Ned Deily [Mon, 18 May 2020 13:17:22 +0000 (09:17 -0400)] 
bpo-26317: Support OBJC and OBJCXX configure command line variables (GH-20176)

Add support to the configure script for OBJC and OBJCXX command line options so that the macOS builds can use the clang compiler for the macOS-specific Objective C source files. This allows third-party compilers, like GNU gcc, to be used to build the rest of the project since some of the Objective C system header files are not compilable by GNU gcc.

Co-authored-by: Jeffrey Kintscher <websurfer@surf2c.net>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agobpo-40548: Github Actions: update actions/checkout to v2 (GH-20164)
Filipe Laíns [Mon, 18 May 2020 12:52:45 +0000 (13:52 +0100)] 
bpo-40548: Github Actions: update actions/checkout to v2 (GH-20164)

Signed-off-by: Filipe Laíns <lains@archlinux.org>
5 years agobpo-34956: Fix macOS _tkinter use of Tcl/Tk in /Library/Frameworks (GH-20171)
Ned Deily [Mon, 18 May 2020 08:32:38 +0000 (04:32 -0400)] 
bpo-34956: Fix macOS _tkinter use of Tcl/Tk in /Library/Frameworks (GH-20171)

_tkinter now builds and links with non-system Tcl and Tk frameworks if they
are installed in /Library/Frameworks as had been the case on older releases
of macOS. If a macOS SDK is explicitly configured, by using ./configure
--enable-universalsdk= or -isysroot, only a Library/Frameworks directory in
the SDK itself is searched. The default behavior can still be overridden with
configure --with-tcltk-includes and --with-tcltk-libs.

5 years agobpo-39148: fixup to account for IPV6_ENABLED being moved (GH-20170)
Nathaniel J. Smith [Mon, 18 May 2020 07:56:47 +0000 (00:56 -0700)] 
bpo-39148: fixup to account for IPV6_ENABLED being moved (GH-20170)

5 years agobpo-39148: enable ipv6 for datagrams in Proactor (GH-19121)
Kjell Braden [Mon, 18 May 2020 06:21:30 +0000 (08:21 +0200)] 
bpo-39148: enable ipv6 for datagrams in Proactor (GH-19121)

Ifdef is not necessary, as AF_INET6 is supported from Windows Vista, and other code in overlapped.c uses AF_INET6 and is not ifdef'd.
Change the raised exception so users are not fooled to think it comes from Windows API.

Automerge-Triggered-By: @njsmith
5 years agobpo-31033: Improve the traceback for cancelled asyncio tasks (GH-19951)
Chris Jerdonek [Mon, 18 May 2020 05:47:31 +0000 (22:47 -0700)] 
bpo-31033: Improve the traceback for cancelled asyncio tasks (GH-19951)

When an asyncio.Task is cancelled, the exception traceback now
starts with where the task was first interrupted.  Previously,
the traceback only had "depth one."

5 years agobpo-13601: Mention stderr's line buffering in What's New (GH-20168)
Shantanu [Mon, 18 May 2020 05:07:57 +0000 (22:07 -0700)] 
bpo-13601: Mention stderr's line buffering in What's New (GH-20168)

5 years agobpo-40651: Improve LRU recipe in the OrderedDict documentation (GH-#20139)
qudongfang [Mon, 18 May 2020 03:50:51 +0000 (04:50 +0100)] 
bpo-40651: Improve LRU recipe in the OrderedDict documentation  (GH-#20139)

5 years agobpo-40665: Use Argument Clinic for the bisect module (GH-20163)
Shantanu [Mon, 18 May 2020 03:38:35 +0000 (20:38 -0700)] 
bpo-40665: Use Argument Clinic for the bisect module (GH-20163)

5 years agobpo-40536: Add zoneinfo.available_timezones (GH-20158)
Paul Ganssle [Mon, 18 May 2020 01:55:11 +0000 (21:55 -0400)] 
bpo-40536: Add zoneinfo.available_timezones (GH-20158)

This was not specified in the PEP, but it will likely be a frequently requested feature if it's not included.

This includes only the "canonical" zones, not a simple listing of every valid value of `key` that can be passed to `Zoneinfo`, because it seems likely that that's what people will want.

5 years agobpo-39058: Preserve attribute order in argparse Namespace reprs. (GH-17621)
Raymond Hettinger [Mon, 18 May 2020 01:53:01 +0000 (18:53 -0700)] 
bpo-39058:  Preserve attribute order in argparse Namespace reprs. (GH-17621)

5 years agobpo-39705 : sorted() tutorial example under looping techniques improved (GH-18999)
Rahul Kumaresan [Mon, 18 May 2020 01:32:34 +0000 (07:02 +0530)] 
bpo-39705 : sorted() tutorial example under looping techniques improved (GH-18999)

5 years agoDoc: change 'Posix' for 'POSIX' (GH-20001)
Mathieu Dupuy [Sun, 17 May 2020 21:29:51 +0000 (21:29 +0000)] 
Doc: change 'Posix' for 'POSIX' (GH-20001)

5 years agoDoc: move a dot outside double quotes (GH-20007)
Mathieu Dupuy [Sun, 17 May 2020 21:24:59 +0000 (21:24 +0000)] 
Doc: move a dot outside double quotes (GH-20007)

5 years agobpo-37630: Fix spelling shake128 -> shake_128 (GH-20154)
Christian Heimes [Sun, 17 May 2020 16:32:38 +0000 (18:32 +0200)] 
bpo-37630: Fix spelling shake128 -> shake_128 (GH-20154)

5 years agobpo-40645: Implement HMAC in C (GH-20129)
Christian Heimes [Sun, 17 May 2020 11:49:10 +0000 (13:49 +0200)] 
bpo-40645: Implement HMAC in C (GH-20129)

The internal module ``_hashlib`` wraps and exposes OpenSSL's HMAC API. The
new code will be used in Python 3.10 after the internal implementation
details of the pure Python HMAC module are no longer part of the public API.

The code is based on a patch by Petr Viktorin for RHEL and Python 3.6.

Co-Authored-By: Petr Viktorin <encukou@gmail.com>
5 years agobpo-39976: Add **other_popen_kwargs to subprocess docs (GH-20145)
Zackery Spytz [Sun, 17 May 2020 10:52:47 +0000 (04:52 -0600)] 
bpo-39976: Add **other_popen_kwargs to subprocess docs (GH-20145)

Patch by Zackery Spytz.

5 years agobpo-35569: add Erlend to Misc/ACKS (GH-20146)
Ned Deily [Sun, 17 May 2020 06:57:25 +0000 (02:57 -0400)] 
bpo-35569: add Erlend to Misc/ACKS (GH-20146)

5 years agobpo-35569: Expose RFC 3542 IPv6 socket options on macOS (GH-19526)
Erlend Egeberg Aasland [Sun, 17 May 2020 06:32:46 +0000 (08:32 +0200)] 
bpo-35569: Expose RFC 3542 IPv6 socket options on macOS (GH-19526)

5 years agobpo-29587: Add another test for the gen.throw() fix. (GH-19859)
Chris Jerdonek [Sun, 17 May 2020 04:14:48 +0000 (21:14 -0700)] 
bpo-29587: Add another test for the gen.throw() fix. (GH-19859)

5 years agobpo-40334: Improvements to error-handling code in the PEG parser (GH-20003)
Lysandros Nikolaou [Sun, 17 May 2020 03:19:23 +0000 (06:19 +0300)] 
bpo-40334: Improvements to error-handling code in the PEG parser (GH-20003)

The following improvements are implemented in this commit:
- `p->error_indicator` is set, in case malloc or realloc fail.
- Avoid memory leaks in the case that realloc fails.
- Call `PyErr_NoMemory()` instead of `PyErr_Format()`, because it requires no memory.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agobpo-38870: Use subTest in test_unparse for better error reporting (GH-20141)
Pablo Galindo [Sun, 17 May 2020 02:53:57 +0000 (03:53 +0100)] 
bpo-38870: Use subTest in test_unparse for better error reporting (GH-20141)

5 years agoUse subTest in test_exceptions for better error reporting (GH-20140)
Pablo Galindo [Sun, 17 May 2020 00:22:00 +0000 (01:22 +0100)] 
Use subTest in test_exceptions for better error reporting (GH-20140)

5 years agobpo-40645: Deprecated internal details of hmac.HMAC (GH-20132)
Christian Heimes [Sat, 16 May 2020 23:05:40 +0000 (01:05 +0200)] 
bpo-40645: Deprecated internal details of hmac.HMAC (GH-20132)

5 years agobpo-38870: Implement round tripping support for typed AST in ast.unparse (GH-17797)
Batuhan Taskaya [Sat, 16 May 2020 23:04:12 +0000 (02:04 +0300)] 
bpo-38870: Implement round tripping support for typed AST in ast.unparse (GH-17797)

5 years agobpo-38870: Correctly handle empty docstrings in ast.unparse (GH-18768)
Batuhan Taskaya [Sat, 16 May 2020 22:49:07 +0000 (01:49 +0300)] 
bpo-38870: Correctly handle empty docstrings in ast.unparse (GH-18768)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agobpo-40165: Suppress stderr when checking if test_stty_match should be skipped (GH...
Batuhan Taskaya [Sat, 16 May 2020 22:38:02 +0000 (01:38 +0300)] 
bpo-40165: Suppress stderr when checking if test_stty_match should be skipped (GH-19325)

5 years agobpo-40211: Clarify os.preadv and os.pwritev are supported on AIX 7.1+ (GH-19401)
Batuhan Taskaya [Sat, 16 May 2020 22:36:40 +0000 (01:36 +0300)] 
bpo-40211: Clarify os.preadv and os.pwritev are supported on AIX 7.1+ (GH-19401)

5 years agobpo-39740: Early declare devpoll_methods to support old compilers (GH-19281)
Batuhan Taskaya [Sat, 16 May 2020 22:36:14 +0000 (01:36 +0300)] 
bpo-39740: Early declare devpoll_methods to support old compilers (GH-19281)

5 years agobpo-38870: Don't put unnecessary parentheses on class declarations in ast.parse ...
Batuhan Taskaya [Sat, 16 May 2020 21:53:25 +0000 (00:53 +0300)] 
bpo-38870: Don't put unnecessary parentheses on class declarations in ast.parse (GH-20134)

5 years agobpo-38870: Do not separate factor prefixes in ast.unparse (GH-20133)
Batuhan Taskaya [Sat, 16 May 2020 21:46:11 +0000 (00:46 +0300)] 
bpo-38870: Do not separate factor prefixes in ast.unparse (GH-20133)

5 years agobpo-37630: Use SHA3 and SHAKE XOF from OpenSSL (GH-16049)
Christian Heimes [Sat, 16 May 2020 20:27:06 +0000 (22:27 +0200)] 
bpo-37630: Use SHA3 and SHAKE XOF from OpenSSL (GH-16049)

OpenSSL 1.1.1 comes with SHA3 and SHAKE builtin.

Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: @tiran
5 years agobpo-40503: Add documentation and what's new entry for zoneinfo (GH-20006)
Paul Ganssle [Sat, 16 May 2020 16:14:58 +0000 (12:14 -0400)] 
bpo-40503: Add documentation and what's new entry for zoneinfo (GH-20006)

This adds the documentation for the `zoneinfo` module added in PEP 615: https://www.python.org/dev/peps/pep-0615/

The implementation itself was GH-19909: https://github.com/python/cpython/pull/19909

bpo-40503: https://bugs.python.org/issue40503

Co-authored-by: Victor Stinner <vstinner@python.org>
5 years agobpo-24416: Return named tuple from date.isocalendar() (GH-20113)
Paul Ganssle [Sat, 16 May 2020 14:02:59 +0000 (10:02 -0400)] 
bpo-24416: Return named tuple from date.isocalendar() (GH-20113)

{date, datetime}.isocalendar() now return a private custom named tuple object
IsoCalendarDate rather than a simple tuple.

In order to leave IsocalendarDate as a private class and to improve what
backwards compatibility is offered for pickling the result of a
datetime.isocalendar() call, add a __reduce__ method to the named tuples that
reduces them to plain tuples. (This is the part of this PR most likely to cause
problems — if it causes major issues, switching to a strucseq or equivalent
would be prudent).

The pure python implementation of IsoCalendarDate uses positional-only
arguments, since it is private and only constructed by position anyway; the
equivalent change in the argument clinic on the C side would require us to move
the forward declaration of the type above the clinic import for whatever
reason, so it seems preferable to hold off on that for now.

bpo-24416: https://bugs.python.org/issue24416

Original PR by Dong-hee Na with only minor alterations by Paul Ganssle.

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
5 years agobpo-39305: Update nntplib to merge nntplib.NNTP and nntplib._NNTPBase (GH-19817)
Dong-hee Na [Sat, 16 May 2020 10:31:54 +0000 (19:31 +0900)] 
bpo-39305: Update nntplib to merge nntplib.NNTP and nntplib._NNTPBase (GH-19817)

5 years agobpo-40275: lazy import modules in test.support (GH-20128)
Hai Shi [Sat, 16 May 2020 10:01:39 +0000 (18:01 +0800)] 
bpo-40275: lazy import modules in test.support (GH-20128)

Automerge-Triggered-By: @vstinner
5 years agobpo-40192: Use thread_cputime for time.thread_time to improve resolution (GH-19381)
Batuhan Taskaya [Sat, 16 May 2020 09:39:09 +0000 (12:39 +0300)] 
bpo-40192: Use thread_cputime for time.thread_time to improve resolution (GH-19381)

On AIX, time.thread_time() is now implemented with thread_cputime()
which has nanosecond resolution, rather than
clock_gettime(CLOCK_THREAD_CPUTIME_ID) which has a resolution of 10 ms.

5 years agobpo-40503: PEP 615: Tests and implementation for zoneinfo (GH-19909)
Paul Ganssle [Sat, 16 May 2020 08:20:06 +0000 (04:20 -0400)] 
bpo-40503: PEP 615: Tests and implementation for zoneinfo (GH-19909)

This is the initial implementation of PEP 615, the zoneinfo module,
ported from the standalone reference implementation (see
https://www.python.org/dev/peps/pep-0615/#reference-implementation for a
link, which has a more detailed commit history).

This includes (hopefully) all functional elements described in the PEP,
but documentation is found in a separate PR. This includes:

1. A pure python implementation of the ZoneInfo class
2. A C accelerated implementation of the ZoneInfo class
3. Tests with 100% branch coverage for the Python code (though C code
   coverage is less than 100%).
4. A compile-time configuration option on Linux (though not on Windows)

Differences from the reference implementation:

- The module is arranged slightly differently: the accelerated module is
  `_zoneinfo` rather than `zoneinfo._czoneinfo`, which also necessitates
  some changes in the test support function. (Suggested by Victor
  Stinner and Steve Dower.)
- The tests are arranged slightly differently and do not include the
  property tests. The tests live at test/test_zoneinfo/test_zoneinfo.py
  rather than test/test_zoneinfo.py or test/test_zoneinfo/__init__.py
  because we may do some refactoring in the future that would likely
  require this separation anyway; we may:
        - include the property tests
        - automatically run all the tests against both pure Python and C,
          rather than manually constructing C and Python test classes (similar
          to the way this works with test_datetime.py, which generates C
          and Python test cases from datetimetester.py).
- This includes a compile-time configuration option on Linux (though not
  on Windows); added with much help from Thomas Wouters.
- Integration into the CPython build system is obviously different from
  building a standalone zoneinfo module wheel.
- This includes configuration to install the tzdata package as part of
  CI, though only on the coverage jobs. Introducing a PyPI dependency as
  part of the CI build was controversial, and this is seen as less of a
  major change, since the coverage jobs already depend on pip and PyPI.

Additional changes that were introduced as part of this PR, most / all of
which were backported to the reference implementation:

- Fixed reference and memory leaks

    With much debugging help from Pablo Galindo

- Added smoke tests ensuring that the C and Python modules are built

    The import machinery can be somewhat fragile, and the "seamlessly falls
    back to pure Python" nature of this module makes it so that a problem
    building the C extension or a failure to import the pure Python version
    might easily go unnoticed.

- Adjustments to zoneinfo.__dir__

    Suggested by Petr Viktorin.

- Slight refactorings as suggested by Steve Dower.

- Removed unnecessary if check on std_abbr

    Discovered this because of a missing line in branch coverage.

5 years agobpo-40457: Support OpenSSL without TLS 1.0/1.1 (GH-19862)
Christian Heimes [Sat, 16 May 2020 01:33:05 +0000 (03:33 +0200)] 
bpo-40457: Support OpenSSL without TLS 1.0/1.1 (GH-19862)

OpenSSL can be build without support for TLS 1.0 and 1.1. The ssl module
now correctly adheres to OPENSSL_NO_TLS1 and OPENSSL_NO_TLS1_1 flags.

Also update multissltest to test with latest OpenSSL and LibreSSL
releases.

Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: @tiran
5 years agobpo-39075: types.SimpleNamespace no longer sorts attributes in its repr (GH-19430)
Zackery Spytz [Sat, 16 May 2020 01:27:54 +0000 (19:27 -0600)] 
bpo-39075: types.SimpleNamespace no longer sorts attributes in its repr (GH-19430)

5 years agobpo-31033: Add a msg argument to Future.cancel() and Task.cancel() (GH-19979)
Chris Jerdonek [Fri, 15 May 2020 23:55:50 +0000 (16:55 -0700)] 
bpo-31033: Add a msg argument to Future.cancel() and Task.cancel() (GH-19979)

5 years agoAdd Andrew York to ACKS for GH-19622. (GH-20105)
Chris Jerdonek [Fri, 15 May 2020 22:19:39 +0000 (15:19 -0700)] 
Add Andrew York to ACKS for GH-19622. (GH-20105)

This updates ACKS for commit 003708bcf8f2c58d4b65f68318acf164d713e008
contributed by Andrew York.

5 years agobpo-40637: Add option to disable builtin hashes (GH-20121)
Christian Heimes [Fri, 15 May 2020 21:54:53 +0000 (23:54 +0200)] 
bpo-40637: Add option to disable builtin hashes (GH-20121)

Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: @tiran
5 years agobpo-40445: Update compileall.compile_dir docs (GH-19806)
Shantanu [Fri, 15 May 2020 21:28:23 +0000 (14:28 -0700)] 
bpo-40445: Update compileall.compile_dir docs (GH-19806)

5 years agobpo-40636: Clarify the zip built-in docstring. (GH-20118)
Gregory P. Smith [Fri, 15 May 2020 21:26:00 +0000 (14:26 -0700)] 
bpo-40636: Clarify the zip built-in docstring. (GH-20118)

Clarify the zip built-in docstring.

This puts much simpler text up front along with an example.

As it was, the zip built-in docstring was technically correct.  But too
technical for the reader who shouldn't _need_ to know about `__next__` and
`StopIteration` as most people do not need to understand the internal
implementation details of the iterator protocol in their daily life.

This is a documentation only change, intended to be backported to 3.8; it is
only tangentially related to PEP-618 which might offer new behavior options
in the future.

Wording based a bit more on enumerate per Brandt's suggestion.

This gets rid of the legacy wording paragraph which seems too tied to
implementation details of the iterator protocol which isn't relevant here.

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
5 years agobpo-40163: Fix multissltest download of old OpenSSL (GH-19329)
Christian Heimes [Fri, 15 May 2020 20:32:25 +0000 (22:32 +0200)] 
bpo-40163: Fix multissltest download of old OpenSSL (GH-19329)

5 years agobpo-40607: Reraise exception during task cancelation in asyncio.wait_for() (GH-20054)
romasku [Fri, 15 May 2020 20:12:05 +0000 (23:12 +0300)] 
bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() (GH-20054)

Currently, if asyncio.wait_for() timeout expires, it cancels
inner future and then always raises TimeoutError. In case
those future is task, it can handle cancelation mannually,
and those process can lead to some other exception. Current
implementation silently loses thoses exception.

To resolve this, wait_for will check was the cancelation
successfull or not. In case there was exception, wait_for
will reraise it.

Co-authored-by: Roman Skurikhin <roman.skurikhin@cruxlab.com>
5 years agobpo-40515: Require OPENSSL_THREADS (GH-19953)
Christian Heimes [Fri, 15 May 2020 18:55:25 +0000 (20:55 +0200)] 
bpo-40515: Require OPENSSL_THREADS (GH-19953)

The ``ssl`` and ``hashlib`` modules now actively check that OpenSSL is
build with thread support. Python 3.7.0 made thread support mandatory and no
longer works safely with a no-thread builds.

Signed-off-by: Christian Heimes <christian@python.org>
5 years agobpo-40479: Test with latest OpenSSL versions (GH-20108)
Christian Heimes [Fri, 15 May 2020 16:48:25 +0000 (18:48 +0200)] 
bpo-40479: Test with latest OpenSSL versions (GH-20108)

* 1.0.2u (EOL)
* 1.1.0l (EOL)
* 1.1.1g
* 3.0.0-alpha2 (disabled for now)

Build the FIPS provider and create a FIPS configuration file for OpenSSL
3.0.0.

Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: @tiran
5 years agobpo-40479: Fix hashlib issue with OpenSSL 3.0.0 (GH-20107)
Christian Heimes [Fri, 15 May 2020 16:28:05 +0000 (18:28 +0200)] 
bpo-40479: Fix hashlib issue with OpenSSL 3.0.0 (GH-20107)

OpenSSL 3.0.0-alpha2 was released today. The FIPS_mode() function has
been deprecated and removed. It no longer makes sense with the new
provider and context system in OpenSSL 3.0.0.

EVP_default_properties_is_fips_enabled() is good enough for our needs in
unit tests. It's an internal API, too.

Signed-off-by: Christian Heimes <christian@python.org>
5 years agobpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)
Victor Stinner [Fri, 15 May 2020 16:06:23 +0000 (18:06 +0200)] 
bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)

distutils.tests now saves/restores warnings filters to leave them
unchanged. Importing tests imports docutils which imports
pkg_resources which adds a warnings filter.

5 years agoTrivial typo fix in _tkinter.c (GH-19622)
Andrew York [Fri, 15 May 2020 10:43:58 +0000 (03:43 -0700)] 
Trivial typo fix in _tkinter.c (GH-19622)

Change spelling of a #define in _tkinter.c from HAVE_LIBTOMMAMTH to HAVE_LIBTOMMATH, since this is used to keep track of tclTomMath.h, not tclTomMamth.h. No other file seems to refer to this variable.

5 years agoFix typo in code comment in main_loop label. (GH-20068)
Chris Jerdonek [Fri, 15 May 2020 02:25:45 +0000 (19:25 -0700)] 
Fix typo in code comment in main_loop label. (GH-20068)

5 years agobpo-40612: Fix SyntaxError edge cases in traceback formatting (GH-20072)
Guido van Rossum [Fri, 15 May 2020 02:22:48 +0000 (19:22 -0700)] 
bpo-40612: Fix SyntaxError edge cases in traceback formatting (GH-20072)

This fixes both the traceback.py module and the C code for formatting syntax errors (in Python/pythonrun.c). They now both consistently do the following:

- Suppress caret if it points left of text
- Allow caret pointing just past end of line
- If caret points past end of line, clip to *just* past end of line

The syntax error formatting code in traceback.py was mostly rewritten; small, subtle changes were applied to the C code in pythonrun.c.

There's still a difference when the text contains embedded newlines. Neither handles these very well, and I don't think the case occurs in practice.

Automerge-Triggered-By: @gvanrossum
5 years agoUpdate code comment re: location of struct _is. (GH-20067)
Chris Jerdonek [Fri, 15 May 2020 02:11:00 +0000 (19:11 -0700)] 
Update code comment re: location of struct _is. (GH-20067)

5 years agobpo-40548: github actions: pass the changes check on no source changes (GH-20097)
Filipe Laíns [Fri, 15 May 2020 02:08:21 +0000 (03:08 +0100)] 
bpo-40548: github actions: pass the changes check on no source changes (GH-20097)

Signed-off-by: Filipe Laíns <lains@archlinux.org>
5 years agobpo-40334: Correctly identify invalid target in assignment errors (GH-20076)
Pablo Galindo [Fri, 15 May 2020 01:04:52 +0000 (02:04 +0100)] 
bpo-40334: Correctly identify invalid target in assignment errors (GH-20076)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
5 years agobpo-38872: Document exec symbol for codeop.compile_command (GH-20047)
Joannah Nanjekye [Fri, 15 May 2020 00:59:46 +0000 (21:59 -0300)] 
bpo-38872: Document exec symbol for codeop.compile_command (GH-20047)

* Document exec symbol for codeop.compile_command

* Remove extra statements

Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com>
5 years agobpo-40462: Fix typo in test_json (GH-20094)
Victor Stinner [Thu, 14 May 2020 23:02:10 +0000 (01:02 +0200)] 
bpo-40462: Fix typo in test_json (GH-20094)

5 years agobpo-40460: Fix typo in idlelib/zzdummy.py (GH-20093)
Victor Stinner [Thu, 14 May 2020 22:51:51 +0000 (00:51 +0200)] 
bpo-40460: Fix typo in idlelib/zzdummy.py (GH-20093)

Replace ztest with ztext.

5 years agobpo-40548: GitHub Action workflow: skip jobs on doc only PRs (GH-19983)
Filipe Laíns [Thu, 14 May 2020 22:11:40 +0000 (23:11 +0100)] 
bpo-40548: GitHub Action workflow: skip jobs on doc only PRs (GH-19983)

Signed-off-by: Filipe Laíns <lains@archlinux.org>
5 years agobpo-40602: _Py_hashtable_set() reports rehash failure (GH-20077)
Victor Stinner [Thu, 14 May 2020 20:44:32 +0000 (22:44 +0200)] 
bpo-40602: _Py_hashtable_set() reports rehash failure (GH-20077)

If _Py_hashtable_set() fails to grow the hash table (rehash), it now
fails rather than ignoring the error.