]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-43757: Make pathlib use os.path.realpath() to resolve symlinks in a path (GH...
Barney Gale [Wed, 28 Apr 2021 15:50:17 +0000 (16:50 +0100)] 
bpo-43757: Make pathlib use os.path.realpath() to resolve symlinks in a path (GH-25264)

Also adds a new "strict" argument to realpath() to avoid changing the default behaviour of pathlib while sharing the implementation.

4 years agobpo-41559: Change PEP 612 implementation to pure Python (#25449)
Ken Jin [Wed, 28 Apr 2021 15:38:14 +0000 (23:38 +0800)] 
bpo-41559: Change PEP 612 implementation to pure Python (#25449)

4 years agobpo-43955: Handle the case where the distutils warning has already been triggered...
Steve Dower [Wed, 28 Apr 2021 15:21:55 +0000 (16:21 +0100)] 
bpo-43955: Handle the case where the distutils warning has already been triggered (GH-25675)

4 years agobpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671)
scoder [Wed, 28 Apr 2021 14:03:19 +0000 (16:03 +0200)] 
bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671)

Automerge-Triggered-By: GH:scoder
4 years agobpo-43961: Fix test_logging.test_namer_rotator_inheritance() (GH-25684)
Victor Stinner [Wed, 28 Apr 2021 13:47:10 +0000 (15:47 +0200)] 
bpo-43961: Fix test_logging.test_namer_rotator_inheritance() (GH-25684)

Fix test_logging.test_namer_rotator_inheritance() on Windows: use
os.replace() rather than os.rename().

4 years agobpo-43962: Fix _PyInterpreterState_IDIncref() (GH-25683)
Victor Stinner [Wed, 28 Apr 2021 11:40:44 +0000 (13:40 +0200)] 
bpo-43962: Fix _PyInterpreterState_IDIncref() (GH-25683)

_PyInterpreterState_IDIncref() now calls
_PyInterpreterState_IDInitref() and always increments id_refcount.

4 years agobpo-43960: test_pdb resets breakpoints (GH-25673)
Irit Katriel [Wed, 28 Apr 2021 10:38:29 +0000 (11:38 +0100)] 
bpo-43960: test_pdb resets breakpoints (GH-25673)

Reset global breakpoint state at the beginning of
test_pdb_next_command_in_generator_for_loop() to make it deterministic.

4 years agobpo-43776: Remove list call from args in Popen repr (GH-25338)
M. Kocher [Wed, 28 Apr 2021 08:16:38 +0000 (01:16 -0700)] 
bpo-43776: Remove list call from args in Popen repr (GH-25338)

Removes the `list` call in the Popen `repr`.

Current implementation:

For cmd = `python --version`,  with `shell=True`.

```bash
<Popen: returncode: None args: ['p', 'y', 't', 'h', 'o', 'n', ' ', '-', '-',...>
```

For `shell=False` and args=`['python', '--version']`, the output is correct:

```bash
<Popen: returncode: None args: ['python', '--version']>
```

With the new changes the `repr`  yields:

For cmd = `python --version`,  with `shell=True`:

```bash
<Popen: returncode: None args: 'python --version'>
```

For `shell=False` and args=`['python', '--version']`, the output:

```bash
<Popen: returncode: None args: ['python', '--version']>
```

Automerge-Triggered-By: GH:gpshead
4 years agobpo-41486: Faster bz2/lzma/zlib via new output buffering (GH-21740)
Ma Lin [Wed, 28 Apr 2021 06:58:54 +0000 (14:58 +0800)] 
bpo-41486: Faster bz2/lzma/zlib via new output buffering (GH-21740)

Faster bz2/lzma/zlib via new output buffering.
Also adds .readall() function to _compression.DecompressReader class
to take best advantage of this in the consume-all-output at once scenario.

Often a 5-20% speedup in common scenarios due to less data copying.

Contributed by Ma Lin.

4 years agobpo-43963: Add _signal module state (GH-25676)
Victor Stinner [Wed, 28 Apr 2021 01:02:55 +0000 (03:02 +0200)] 
bpo-43963: Add _signal module state (GH-25676)

* Add signal_state_t structure and signal_global_state variable.
* Add a module state to the _signal module.
* Move and rename variables:

  * DefaultHandler becomes state->default_handler
  * IgnoreHandler becomes state->ignore_handler
  * sigint_event becomes state->sigint_event
  * ItimerError becomes modstate->itimer_error

* Rename SetHandler() to set_handler() to be consistent with
  get_handler().

4 years agobpo-37751: Update `codecs.register()` doc. (GH-25643)
Inada Naoki [Wed, 28 Apr 2021 00:37:02 +0000 (09:37 +0900)] 
bpo-37751: Update `codecs.register()` doc. (GH-25643)

4 years agobpo-43963: Fix import _signal in subinterpreters (GH-25674)
Victor Stinner [Tue, 27 Apr 2021 23:50:04 +0000 (01:50 +0200)] 
bpo-43963: Fix import _signal in subinterpreters (GH-25674)

Importing the _signal module in a subinterpreter has no longer side
effects.

signal_module_exec() no longer modifies Handlers and no longer attempts
to set SIGINT signal handler in subinterpreters.

4 years agobpo-43957: [Enum] Deprecate ``TypeError`` from containment checks. (GH-25670)
Ethan Furman [Tue, 27 Apr 2021 20:05:08 +0000 (13:05 -0700)] 
bpo-43957: [Enum] Deprecate ``TypeError`` from containment checks. (GH-25670)

In 3.12 ``True`` or ``False`` will be returned for all containment checks,
with ``True`` being returned if the value is either a member of that enum
or one of its members' value.

4 years agobpo-8978: improve tarfile.open error message when lzma / bz2 are missing (GH-24850)
Anthony Sottile [Tue, 27 Apr 2021 17:39:01 +0000 (10:39 -0700)] 
bpo-8978: improve tarfile.open error message when lzma / bz2 are missing (GH-24850)

Automerge-Triggered-By: GH:pablogsal
4 years agoFix generated file name for installer builds on macOS 11+. (GH-25661)
Ned Deily [Tue, 27 Apr 2021 17:23:39 +0000 (13:23 -0400)] 
Fix generated file name for installer builds on macOS 11+. (GH-25661)

4 years agobpo-43492: Update macOS installer to use SQLite 3.35.5 (GH-25640)
Erlend Egeberg Aasland [Tue, 27 Apr 2021 17:19:14 +0000 (19:19 +0200)] 
bpo-43492: Update macOS installer to use SQLite 3.35.5 (GH-25640)

4 years agobpo-43492: Upgrade Windows installer to use SQLite 3.35.5 (GH-25641)
Erlend Egeberg Aasland [Tue, 27 Apr 2021 16:23:53 +0000 (18:23 +0200)] 
bpo-43492: Upgrade Windows installer to use SQLite 3.35.5 (GH-25641)

4 years agobpo-43864: Silence deprecation warning in test_importlib.test_module_found and test_i...
Shreyan Avigyan [Tue, 27 Apr 2021 15:56:08 +0000 (21:26 +0530)] 
bpo-43864: Silence deprecation warning in test_importlib.test_module_found and test_importlib.test_module_not_found (GH-25656)

4 years agobpo-43766: Fix TypeGuard docs (#25660)
Ken Jin [Tue, 27 Apr 2021 15:55:08 +0000 (23:55 +0800)] 
bpo-43766: Fix TypeGuard docs (#25660)

4 years agobpo-43766: Implement PEP 647 (User-Defined Type Guards) in typing.py (#25282)
Ken Jin [Tue, 27 Apr 2021 14:31:04 +0000 (22:31 +0800)] 
bpo-43766: Implement PEP 647 (User-Defined Type Guards) in typing.py (#25282)

4 years agobpo-43312: Functions returning default and preferred sysconfig schemes (GH-24644)
Tzu-ping Chung [Tue, 27 Apr 2021 08:45:55 +0000 (16:45 +0800)] 
bpo-43312: Functions returning default and preferred sysconfig schemes (GH-24644)

4 years agoFix thread locks in zlib module may go wrong in rare case. (#22126)
Ma Lin [Tue, 27 Apr 2021 08:37:11 +0000 (16:37 +0800)] 
Fix thread locks in zlib module may go wrong in rare case. (#22126)

Setting `next_in` before acquiring the thread lock may mix up compress/decompress state in other threads.

4 years agobpo-43651: Fix EncodingWarning in fileinput and its test (GH-25648)
Inada Naoki [Tue, 27 Apr 2021 06:47:16 +0000 (15:47 +0900)] 
bpo-43651: Fix EncodingWarning in fileinput and its test (GH-25648)

4 years agobpo-43651: Fix EncodingWarning in zipfile (GH-25650)
Inada Naoki [Tue, 27 Apr 2021 06:45:31 +0000 (15:45 +0900)] 
bpo-43651: Fix EncodingWarning in zipfile (GH-25650)

4 years agobpo-43945: [Enum] Deprecate non-standard mixin format() behavior (GH-25649)
Ethan Furman [Tue, 27 Apr 2021 05:42:57 +0000 (22:42 -0700)] 
bpo-43945: [Enum] Deprecate non-standard mixin format() behavior (GH-25649)

In 3.12 the enum member, not the member's value, will be used for
format() calls.  Format specifiers can be used to retain the current
display of enum members:

Example enumeration:

    class Color(IntEnum):
        RED = 1
        GREEN = 2
        BLUE = 3

Current behavior:

    f'{Color.RED}'  -->  '1'

Future behavior:

    f'{Color.RED}'  --> 'RED'

Using d specifier:

    f'{Color.RED:d}'  --> '1'

Using specifiers can be done now and is future-compatible.

4 years agobpo-43651: PEP 597: Fix `socket.makefile()` (GH-25645)
Inada Naoki [Tue, 27 Apr 2021 04:16:28 +0000 (13:16 +0900)] 
bpo-43651: PEP 597: Fix `socket.makefile()` (GH-25645)

4 years ago[doc] Remove duplicated operator.itemgetter example (GH-24178)
Andre Delfino [Tue, 27 Apr 2021 04:15:31 +0000 (01:15 -0300)] 
[doc] Remove duplicated operator.itemgetter example (GH-24178)

* Remove duplicated itemgetter example
* Add spaces

4 years agobpo-43651: Fix EncodingWarning in `pydoc`. (GH-25644)
Inada Naoki [Tue, 27 Apr 2021 03:46:20 +0000 (12:46 +0900)] 
bpo-43651: Fix EncodingWarning in `pydoc`. (GH-25644)

4 years agobpo-38530: Require 50% similarity in NameError and AttributeError suggestions (GH...
Dennis Sweeney [Tue, 27 Apr 2021 00:22:27 +0000 (20:22 -0400)] 
bpo-38530: Require 50% similarity in NameError and AttributeError suggestions (GH-25584)

4 years agobpo-43762: Add audit events for loading of sqlite3 extensions (GH-25246)
Erlend Egeberg Aasland [Mon, 26 Apr 2021 23:16:46 +0000 (01:16 +0200)] 
bpo-43762: Add audit events for loading of sqlite3 extensions (GH-25246)

4 years agoUse the zero argument form of super() in examples for Python3 docs. (GH-22314)
Andre Delfino [Mon, 26 Apr 2021 22:13:54 +0000 (19:13 -0300)] 
Use the zero argument form of super() in examples for Python3 docs. (GH-22314)

4 years agobpo-40432: Use python 3.8 or higher to compile CPython on Windows (#25389)
Ken Jin [Mon, 26 Apr 2021 19:11:43 +0000 (03:11 +0800)] 
bpo-40432: Use python 3.8 or higher to compile CPython on Windows (#25389)

4 years agobpo-43938: improve dataclasses.FrozenInstanceError documentation (GH-25603)
Llandy Riveron Del Risco [Mon, 26 Apr 2021 18:53:28 +0000 (20:53 +0200)] 
bpo-43938: improve dataclasses.FrozenInstanceError documentation (GH-25603)

4 years agobpo-42904: Change search order of typing.get_type_hints eval (#25632)
Ken Jin [Mon, 26 Apr 2021 17:31:21 +0000 (01:31 +0800)] 
bpo-42904: Change search order of typing.get_type_hints eval (#25632)

While surprising (searching globals before locals in one specific case), this is needed for backwards compatibility.

4 years agoAdd additional keyword-only tests. (GH-25633)
Eric V. Smith [Mon, 26 Apr 2021 17:14:28 +0000 (13:14 -0400)] 
Add additional keyword-only tests. (GH-25633)

4 years agoDoc: Fix the array.fromfile method doc (GH-22037)
Adorilson Bezerra [Mon, 26 Apr 2021 14:19:21 +0000 (11:19 -0300)] 
Doc: Fix the array.fromfile method doc (GH-22037)

The check about the f argument type was removed in this commit:
https://github.com/python/cpython/commit/2c94aa567e525c82041ad68a3174d8c3acbf37e2

Thanks for Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) by the help with
this bug.

4 years agobpo-43466: Link with libz in PY_UNSUPPORTED_OPENSSL_BUILD path (GH-25587)
Christian Heimes [Mon, 26 Apr 2021 13:13:34 +0000 (15:13 +0200)] 
bpo-43466: Link with libz in PY_UNSUPPORTED_OPENSSL_BUILD path (GH-25587)

Some OpenSSL build flavors need libz for compression support.

4 years agobpo-18233: Add internal methods to access peer chain (GH-25467)
Christian Heimes [Mon, 26 Apr 2021 13:01:40 +0000 (15:01 +0200)] 
bpo-18233: Add internal methods to access peer chain (GH-25467)

The internal `_ssl._SSLSocket` object now provides methods to retrieve
the peer cert chain and verified cert chain as a list of Certificate
objects. Certificate objects have methods to convert the cert to a dict,
PEM, or DER (ASN.1).

These are private APIs for now. There is a slim chance to stabilize the
approach and provide a public API for 3.10. Otherwise I'll provide a
stable API in 3.11.

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-38820: Old OpenSSL 3.0.0 releases are in /old/3.0/ (GH-25624)
Christian Heimes [Mon, 26 Apr 2021 08:54:12 +0000 (10:54 +0200)] 
bpo-38820: Old OpenSSL 3.0.0 releases are in /old/3.0/ (GH-25624)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agoUpdate asyncio-subprocess.rst (GH-21680)
Gabriel R F [Mon, 26 Apr 2021 04:38:16 +0000 (01:38 -0300)] 
Update asyncio-subprocess.rst (GH-21680)

4 years agodocumentation: clarification about the function remove in os library (GH-19024)
Etienne Gautier [Mon, 26 Apr 2021 04:21:50 +0000 (06:21 +0200)] 
documentation: clarification about the function remove in os library (GH-19024)

4 years agoFix documentation typos of argparse exit_on_error (GH-22706)
Taneli Hukkinen [Mon, 26 Apr 2021 04:04:26 +0000 (06:04 +0200)] 
Fix documentation typos of argparse exit_on_error (GH-22706)

4 years agoQuick pydoc update to smtplib.py (GH-22292)
uy-rrodriguez [Mon, 26 Apr 2021 01:56:37 +0000 (02:56 +0100)] 
Quick pydoc update to smtplib.py (GH-22292)

Fixing minor mistake in the quotes around a couple of arguments for the constructor of the class `SMTP`, in smtplib.py.

4 years agoFix id of 'Internet Message Format' RFC in email doc (GH-24137)
Denis Laxalde [Mon, 26 Apr 2021 01:38:12 +0000 (03:38 +0200)] 
Fix id of 'Internet Message Format' RFC in email doc (GH-24137)

Previous ID (5233) refers to "Sieve Email Filtering: Subaddress
Extension". It seems that the actual reference should be "Internet
Message Format" RFC 5322 (https://tools.ietf.org/html/rfc5322).

(The typo probably comes from commit 29d1bc0842 in which the ID of
this RFC got updated from the obsolete 2822.)

Co-authored-by: Ambrose Chua <ambrose@hey.com>
4 years agoFix copy.Error casing in documentation GH-22004
Andre Delfino [Mon, 26 Apr 2021 01:22:28 +0000 (22:22 -0300)] 
Fix copy.Error casing in documentation GH-22004

4 years agoFix broken links and improve stand-alone tools list in FAQ GH-22124
Andre Delfino [Mon, 26 Apr 2021 01:10:05 +0000 (22:10 -0300)] 
Fix broken links and improve stand-alone tools list in FAQ GH-22124

4 years agoAdd keyword-only fields to dataclasses. (GH=25608)
Eric V. Smith [Mon, 26 Apr 2021 00:42:39 +0000 (20:42 -0400)] 
Add keyword-only fields to dataclasses. (GH=25608)

4 years agoRemove mention of dst parameter from description of os.lstat() (GH-24704)
Sergey Fedoseev [Sun, 25 Apr 2021 21:24:41 +0000 (02:24 +0500)] 
Remove mention of dst parameter from description of os.lstat() (GH-24704)

It looks like it was accidentally copy-pasted in
6fa7aada9bd3616e0beeb266e818497b2ec1c859.

4 years agoFix a typo in datamodel reference document (GH-24930)
Géry Ogam [Sun, 25 Apr 2021 21:13:19 +0000 (23:13 +0200)] 
Fix a typo in datamodel reference document (GH-24930)

4 years agobpo-38605: Update __future__ module doc as `annotations` is now "mandatory in 3.11...
Saiyang Gou [Sun, 25 Apr 2021 19:49:26 +0000 (12:49 -0700)] 
bpo-38605: Update __future__ module doc as `annotations` is now "mandatory in 3.11" (GH-25602)

4 years agofix typo in warning (#20620)
Allen [Sun, 25 Apr 2021 17:45:05 +0000 (13:45 -0400)] 
fix typo in warning (#20620)

* Add space after period to warning in _tzpath.py

Currently:
InvalidTZPathWarning: Invalid paths specified in PYTHONTZPATH environment variable.Paths should be absolute but found the following relative paths: ...

* Update _tzpath.py

4 years agoBaseHTTPRequestHandler, that path includes query (#25597)
Senthil Kumaran [Sun, 25 Apr 2021 17:08:29 +0000 (10:08 -0700)] 
BaseHTTPRequestHandler, that path includes query (#25597)

* Clarify, for BaseHTTPRequestHandler, that path includes query

Co-authored-by: David Jones <drj@pobox.com>
4 years agoSet the release for `__future__.annotations` to 3.11 (#25596)
Anthony Sottile [Sun, 25 Apr 2021 16:09:24 +0000 (09:09 -0700)] 
Set the release for `__future__.annotations` to 3.11 (#25596)

4 years agobpo-43534: Fix the turtle module working with multiple root windows (GH-25591)
Serhiy Storchaka [Sun, 25 Apr 2021 14:49:32 +0000 (17:49 +0300)] 
bpo-43534: Fix the turtle module working with multiple root windows (GH-25591)

4 years agobpo-38490: statistics: Add covariance, Pearson's correlation, and simple linear regre...
Tymoteusz Wołodźko [Sun, 25 Apr 2021 11:45:09 +0000 (13:45 +0200)] 
bpo-38490: statistics: Add covariance, Pearson's correlation, and simple linear regression (#16813)

Co-authored-by: Tymoteusz Wołodźko <twolodzko+gitkraken@gmail.com
4 years agobpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() (GH-23554)
Serhiy Storchaka [Sun, 25 Apr 2021 10:40:44 +0000 (13:40 +0300)] 
bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() (GH-23554)

asyncio.get_event_loop() emits now a deprecation warning when it creates a new event loop.
In future releases it will became an alias of asyncio.get_running_loop().

4 years agobpo-42609: Check recursion depth in the AST validator and optimizer (GH-23744)
Serhiy Storchaka [Sun, 25 Apr 2021 10:38:00 +0000 (13:38 +0300)] 
bpo-42609: Check recursion depth in the AST validator and optimizer (GH-23744)

4 years agobpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient again...
Serhiy Storchaka [Sun, 25 Apr 2021 10:16:49 +0000 (13:16 +0300)] 
bpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient again (GH-24923)

4 years agobpo-43655: Tkinter and IDLE dialog windows are now recognized as dialogs by window...
Serhiy Storchaka [Sun, 25 Apr 2021 10:07:58 +0000 (13:07 +0300)] 
bpo-43655: Tkinter and IDLE dialog windows are now recognized as dialogs by window managers on macOS and X Window (#25187)

4 years agobpo-42737: annotations with complex targets no longer causes any runtime effects...
Batuhan Taskaya [Sun, 25 Apr 2021 02:31:20 +0000 (05:31 +0300)] 
bpo-42737: annotations with complex targets no longer causes any runtime effects (GH-23952)

4 years agobpo-43930: Update bundled pip to 21.1 and setuptools to 56.0.0 (GH-25576)
Stéphane Bidoul [Sat, 24 Apr 2021 16:21:50 +0000 (18:21 +0200)] 
bpo-43930: Update bundled pip to 21.1 and setuptools to 56.0.0 (GH-25576)

Update bundled pip to 21.1 and setuptools to 56.0.0

4 years agobpo-43780: Sync with importlib_metadata 3.10 (GH-25297)
Jason R. Coombs [Sat, 24 Apr 2021 14:13:51 +0000 (10:13 -0400)] 
bpo-43780: Sync with importlib_metadata 3.10 (GH-25297)

* bpo-43780: Sync with importlib_metadata 3.10.

* Add blurb

* Apply changes from importlib_metadata 3.10.1.

4 years agobpo-43921: also accept EOF in post-handshake auth test (GH-25574)
Christian Heimes [Sat, 24 Apr 2021 13:08:13 +0000 (15:08 +0200)] 
bpo-43921: also accept EOF in post-handshake auth test (GH-25574)

4 years agobpo-41282: Consistent message and filter warning in setup.py (GH-25571)
Christian Heimes [Sat, 24 Apr 2021 07:55:15 +0000 (09:55 +0200)] 
bpo-41282: Consistent message and filter warning in setup.py (GH-25571)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-37322: Fix ResourceWarning and exception handling in test (GH-25553)
Christian Heimes [Sat, 24 Apr 2021 07:17:54 +0000 (09:17 +0200)] 
bpo-37322: Fix ResourceWarning and exception handling in test (GH-25553)

Revert 73ea546, increase logging, and improve stability of test.

Handle all OSErrors in a single block. OSError also takes care of
SSLError and socket's connection errors.

Partly reverts commit fb7e750. The
threaded connection handler must not raise an unhandled exception.

4 years agobpo-31870: Fix test_get_server_certificate_timeout on Windows (GH-25570)
Christian Heimes [Sat, 24 Apr 2021 05:54:08 +0000 (07:54 +0200)] 
bpo-31870: Fix test_get_server_certificate_timeout on Windows (GH-25570)

Some OS do not support millisecond granularity in select(). Use 100ms
timeout and a server callback with sleep to emulate a slow server.

4 years agobpo-31870: Add a timeout parameter to ssl.get_server_certificate() (GH-22270)
Zackery Spytz [Sat, 24 Apr 2021 04:46:01 +0000 (22:46 -0600)] 
bpo-31870: Add a timeout parameter to ssl.get_server_certificate() (GH-22270)

4 years agobpo-38659: [Enum] do not check '_inverted_' during simple test (GH-25566)
Ethan Furman [Sat, 24 Apr 2021 02:08:22 +0000 (19:08 -0700)] 
bpo-38659: [Enum] do not check '_inverted_' during simple test (GH-25566)

Depending on usage, it's possible for Flag members to have the _inverted_ attribute when they are testing, while the Flag being testing against will not have that attribute on its members -- so skip that comparison.

4 years agoRestrict GITHUB_TOKEN permissions for the 'stale' workflow (GH-25564)
Brett Cannon [Fri, 23 Apr 2021 22:18:50 +0000 (15:18 -0700)] 
Restrict GITHUB_TOKEN permissions for the 'stale' workflow (GH-25564)

It should only need write-level permissions to pull requests.

4 years agobpo-30555: Fix WindowsConsoleIO fails in the presence of fd redirection (GH-1927)
Segev Finer [Fri, 23 Apr 2021 22:00:27 +0000 (01:00 +0300)] 
bpo-30555: Fix WindowsConsoleIO fails in the presence of fd redirection (GH-1927)

This works by not caching the handle and instead getting the handle from
the file descriptor each time, so that if the actual handle changes by
fd redirection closing/opening the console handle beneath our feet, we
will keep working correctly.

4 years agobop-43652: Update Tcl and Tk to 8.6.11 in Windows installer (GH-25170)
Terry Jan Reedy [Fri, 23 Apr 2021 21:40:42 +0000 (17:40 -0400)] 
bop-43652: Update Tcl and Tk to 8.6.11 in Windows installer (GH-25170)

4 years agoSilence find_module() DeprecationWarning on Windows tests (GH-25563)
Brett Cannon [Fri, 23 Apr 2021 21:40:18 +0000 (14:40 -0700)] 
Silence find_module() DeprecationWarning on Windows tests (GH-25563)

4 years agobpo-43907: add missing memoize call in pure python pickling of bytearray (GH-25501)
Carl Friedrich Bolz-Tereick [Fri, 23 Apr 2021 21:27:14 +0000 (23:27 +0200)] 
bpo-43907: add missing memoize call in pure python pickling of bytearray (GH-25501)

4 years agobpo-39950: add `pathlib.Path.hardlink_to()` method that supersedes `link_to()` (GH...
Barney Gale [Fri, 23 Apr 2021 20:48:52 +0000 (21:48 +0100)] 
bpo-39950: add `pathlib.Path.hardlink_to()` method that supersedes `link_to()` (GH-18909)

The argument order of `link_to()` is reversed compared to what one may expect, so:

    a.link_to(b)

Might be expected to create *a* as a link to *b*, in fact it creates *b* as a link to *a*, making it function more like a "link from". This doesn't match `symlink_to()` nor the documentation and doesn't seem to be the original author's intent.

This PR deprecates `link_to()` and introduces `hardlink_to()`, which has the same argument order as `symlink_to()`.

4 years agobpo-43921: ignore failing test_wrong_cert_tls13 on Windows (GH-25561)
Christian Heimes [Fri, 23 Apr 2021 18:03:25 +0000 (20:03 +0200)] 
bpo-43921: ignore failing test_wrong_cert_tls13 on Windows (GH-25561)

test_wrong_cert_tls13 sometimes fails on some Windows buildbots. Turn
failing test case into skipped test case until we have more time to
investigate.

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-43538: Add extra arguments to os.startfile (GH-25538)
Steve Dower [Fri, 23 Apr 2021 17:03:17 +0000 (18:03 +0100)] 
bpo-43538: Add extra arguments to os.startfile (GH-25538)

4 years agobpo-43607: Fix urllib handling of Windows paths with \\?\ prefix (GH-25539)
Steve Dower [Fri, 23 Apr 2021 17:02:47 +0000 (18:02 +0100)] 
bpo-43607: Fix urllib handling of Windows paths with \\?\ prefix (GH-25539)

4 years agobpo-35114: Make ssl.RAND_status() return a bool (GH-20063)
Zackery Spytz [Fri, 23 Apr 2021 16:07:37 +0000 (10:07 -0600)] 
bpo-35114: Make ssl.RAND_status() return a bool (GH-20063)

4 years agobpo-43914: Highlight invalid ranges in SyntaxErrors (#25525)
Pablo Galindo [Fri, 23 Apr 2021 13:27:05 +0000 (14:27 +0100)] 
bpo-43914: Highlight invalid ranges in SyntaxErrors (#25525)

To improve the user experience understanding what part of the error messages associated with SyntaxErrors is wrong, we can highlight the whole error range and not only place the caret at the first character. In this way:

>>> foo(x, z for z in range(10), t, w)
  File "<stdin>", line 1
    foo(x, z for z in range(10), t, w)
           ^
SyntaxError: Generator expression must be parenthesized

becomes

>>> foo(x, z for z in range(10), t, w)
  File "<stdin>", line 1
    foo(x, z for z in range(10), t, w)
           ^^^^^^^^^^^^^^^^^^^^
SyntaxError: Generator expression must be parenthesized

4 years agobpo-43868: Remove PyOS_ReadlineFunctionPointer from the stable ABI list (GH-25442)
Petr Viktorin [Fri, 23 Apr 2021 12:23:38 +0000 (14:23 +0200)] 
bpo-43868: Remove PyOS_ReadlineFunctionPointer from the stable ABI list (GH-25442)

The inclusion of PyOS_ReadlineFunctionPointer in python3dll.c was a mistake.

According to PEP 384:
> functions expecting FILE* are not part of the ABI, to avoid depending
> on a specific version of the Microsoft C runtime DLL on Windows.

https://bugs.python.org/issue43868

4 years agobpo-38820: Test with OpenSSL 3.0.0-alpha15 (GH-25537)
Christian Heimes [Fri, 23 Apr 2021 12:19:21 +0000 (14:19 +0200)] 
bpo-38820: Test with OpenSSL 3.0.0-alpha15 (GH-25537)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-43795: PEP-652: Clean up the stable ABI/limited API (GH-25482)
Petr Viktorin [Fri, 23 Apr 2021 12:17:58 +0000 (14:17 +0200)] 
bpo-43795: PEP-652: Clean up the stable ABI/limited API (GH-25482)

- `_Py_EncodeLocaleRaw`, which is private by name, undocumented,
  and wasn't exported in `python3.dll`, is moved to a private header.
- `_Py_HashSecret_Initialized`, again private by name, undocumented,
  and not exported in `python3.dll`, is excluded with `Py_LIMITED_API`.
- `PyMarshal_*` and `PyMember_*One` functions, declared in private headers and
  not exported in `python3.dll`, are removed from `Doc/data/stable_abi.dat`.
- `PyMem_Calloc` which *was* exported in `python3dll.c`, is moved to public
  headers where it joins its other `PyMem_*` friends.

Only the last change is documented in the blurb; others are not user-visible.
(Nothing uses `Doc/data/stable_abi.dat` yet.)

https://bugs.python.org/issue43795

4 years agobpo-43795: PEP-652: Simplify headers for easier static analysis (GH-25483)
Petr Viktorin [Fri, 23 Apr 2021 12:14:00 +0000 (14:14 +0200)] 
bpo-43795: PEP-652: Simplify headers for easier static analysis (GH-25483)

As part of the PEP-652 implementation, I'll tighten the CI check
for functions/data defined with `Py_LIMITED_API`.

Discussion in https://discuss.python.org/t/pep-652-maintaining-the-stable-abi/6986
suggests that parsing C headers is OK (though personally I'd rather generate it...),
but writing a full C parser is a monumental task and adding an existing one as a
dependency brings too many vendoring/bootstraping issues.

So, for the check I'll use a "simple" regex on preprocessor output, and adapt
the few trivial places where the regex won't work.

- Keep declarations in the limited API to one item per line
- Make it possible to override `_Py_NO_RETURN`, so the annotation can be
  removed from preprocessor output.

https://bugs.python.org/issue43795

4 years agobpo-41282: (PEP 632) Deprecate distutils.sysconfig (partial implementation of the...
Lumír 'Frenzy' Balhar [Fri, 23 Apr 2021 12:02:41 +0000 (14:02 +0200)] 
bpo-41282: (PEP 632) Deprecate distutils.sysconfig (partial implementation of the PEP) (GH-23142)

This change:
* merges `distutils.sysconfig` into `sysconfig` while keeping the original functionality and
* marks `distutils.sysconfig` as deprecated

https://bugs.python.org/issue41282

4 years agobpo-43920: Make load_verify_locations(cadata) error message consistent (GH-25554)
Christian Heimes [Fri, 23 Apr 2021 11:51:40 +0000 (13:51 +0200)] 
bpo-43920: Make load_verify_locations(cadata) error message consistent (GH-25554)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-43852: Improve tuple creation in sqlite3 (GH-25421)
Erlend Egeberg Aasland [Fri, 23 Apr 2021 11:21:08 +0000 (13:21 +0200)] 
bpo-43852: Improve tuple creation in sqlite3 (GH-25421)

4 years agobpo-37363: Add audit events to the `http.client` module (GH-21321)
Saiyang Gou [Fri, 23 Apr 2021 10:19:08 +0000 (03:19 -0700)] 
bpo-37363: Add audit events to the `http.client` module (GH-21321)

Add audit events to the `http.client` module

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
4 years agobpo-37751: Document codecs.lookup() change in What's New in Python 3.9 (GH-23096)
Hai Shi [Fri, 23 Apr 2021 09:10:43 +0000 (17:10 +0800)] 
bpo-37751: Document codecs.lookup() change in What's New in Python 3.9 (GH-23096)

4 years agoAdd more tests. Fix code excerpt. (GH-25549)
Raymond Hettinger [Fri, 23 Apr 2021 03:02:46 +0000 (20:02 -0700)] 
Add more tests.  Fix code excerpt. (GH-25549)

4 years agoReformat idlelib colorizer (GH-25479)
E-Paine [Fri, 23 Apr 2021 01:21:53 +0000 (02:21 +0100)] 
Reformat idlelib colorizer (GH-25479)

Also replace if-then and and-or with conditional expressions.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 years agobpo-43917: Fix pure python equivalent for classmethod (GH-25544)
Raymond Hettinger [Fri, 23 Apr 2021 00:53:36 +0000 (17:53 -0700)] 
bpo-43917: Fix pure python equivalent for classmethod (GH-25544)

Reported by Yahor Harunovich.

4 years agobpo-39572: Address typo in CHANGELOG. (GH-24999)
Simon Charette [Fri, 23 Apr 2021 00:35:11 +0000 (20:35 -0400)] 
bpo-39572: Address typo in CHANGELOG. (GH-24999)

4 years agobpo-38222: Check specifically for a drive, not just a colon (GH-25540)
Steve Dower [Thu, 22 Apr 2021 23:30:37 +0000 (00:30 +0100)] 
bpo-38222: Check specifically for a drive, not just a colon (GH-25540)

4 years agobpo-35306: Avoid raising OSError from pathlib.Path.exists when passed an invalid...
Steve Dower [Thu, 22 Apr 2021 20:04:44 +0000 (21:04 +0100)] 
bpo-35306: Avoid raising OSError from pathlib.Path.exists when passed an invalid filename (GH-25529)

4 years agobpo-43915: Add PCbuild/blurb.bat to simplify Windows contributors (GH-25528)
Steve Dower [Thu, 22 Apr 2021 19:45:47 +0000 (20:45 +0100)] 
bpo-43915: Add PCbuild/blurb.bat to simplify Windows contributors (GH-25528)

4 years agobpo-38822: Fixed os.stat failing on inaccessible directories. (GH-25527)
Steve Dower [Thu, 22 Apr 2021 19:45:02 +0000 (20:45 +0100)] 
bpo-38822: Fixed os.stat failing on inaccessible directories. (GH-25527)

It would just fail if the path was inaccessible and had a trailing slash. It should fall back to the parent directory's metadata.

4 years agobpo-43284: Update platform.win32_ver to use _syscmd_ver instead of sys.getwindowsvers...
Shreyan Avigyan [Thu, 22 Apr 2021 16:43:37 +0000 (22:13 +0530)] 
bpo-43284: Update platform.win32_ver to use _syscmd_ver instead of sys.getwindowsversion() (GH-25500)

The sys module uses the kernel32.dll version number, which can vary from the "actual" Windows version.
Since the best option for getting the version is WMI (which is expensive), we switch back to launching cmd.exe (which is also expensive, but a lot less code on our part).
sys.getwindowsversion() is not updated to avoid launching executables from that module.

4 years agobpo-43475: Fix worst case collision behavior for NaN instances (GH-25493)
Raymond Hettinger [Thu, 22 Apr 2021 15:34:57 +0000 (08:34 -0700)] 
bpo-43475:  Fix worst case collision behavior for NaN instances (GH-25493)

4 years agoFix typo in the documentation (GH-24703)
Alperen Serkan Aksöz [Thu, 22 Apr 2021 14:36:05 +0000 (17:36 +0300)] 
Fix typo in the documentation (GH-24703)

Missing multiply symbol added

Automerge-Triggered-By: GH:merwok
4 years agobpo-28724: Doc: Move socket.send_fds and socket.recv_fds docs to right section (GH...
Saiyang Gou [Thu, 22 Apr 2021 04:08:46 +0000 (21:08 -0700)] 
bpo-28724: Doc: Move socket.send_fds and socket.recv_fds docs to right section (GH-22608)