]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agobpo-40280: Skip more tests on Emscripten (GH-31947)
Christian Heimes [Thu, 17 Mar 2022 11:09:57 +0000 (13:09 +0200)] 
bpo-40280: Skip more tests on Emscripten (GH-31947)

- lchmod, lchown are not fully implemented
- skip umask tests
- cannot fstat unlinked or renamed files yet
- ignore musl libc issues that affect Emscripten

3 years agobpo-46996: Remove support of Tcl/Tk < 8.5.12 (GH-31839)
Serhiy Storchaka [Thu, 17 Mar 2022 11:05:52 +0000 (13:05 +0200)] 
bpo-46996: Remove support of Tcl/Tk < 8.5.12 (GH-31839)

3 years agoDo not run test_gdb when gdb embeds Python 2. (GH-31956)
Inada Naoki [Thu, 17 Mar 2022 09:00:56 +0000 (18:00 +0900)] 
Do not run test_gdb when gdb embeds Python 2. (GH-31956)

3 years agobpo-46981: Remove typing._TypingEmpty (GH-31836)
Serhiy Storchaka [Thu, 17 Mar 2022 07:52:24 +0000 (09:52 +0200)] 
bpo-46981: Remove typing._TypingEmpty (GH-31836)

* get_args(Tuple[()]) now returns () instead of ((),).
* Tuple[Unpack[Ts]][()] now returns the result equal to Tuple[()].

3 years agobpo-44859: Raise more accurate exceptions in `sqlite3` (GH-27695)
Erlend Egeberg Aasland [Thu, 17 Mar 2022 05:58:25 +0000 (06:58 +0100)] 
bpo-44859: Raise more accurate exceptions in `sqlite3` (GH-27695)

* Improve exception compliance with PEP 249
* Raise InterfaceError instead of ProgrammingError for SQLITE_MISUSE.
  If SQLITE_MISUSE is raised, it is a sqlite3 module bug. Users of the
  sqlite3 module are not responsible for using the SQLite C API correctly.
* Don't overwrite BufferError with ValueError when conversion to BLOB fails.
* Raise ProgrammingError instead of Warning if user tries to execute() more
  than one SQL statement.
* Raise ProgrammingError instead of ValueError if an SQL query contains null characters.
* Make sure `_pysqlite_set_result` raises an exception if it returns -1.

3 years agobpo-46480: add typing.assert_type (GH-30843)
Jelle Zijlstra [Thu, 17 Mar 2022 03:02:26 +0000 (20:02 -0700)] 
bpo-46480: add typing.assert_type (GH-30843)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: David Foster <david@dafoster.net>
3 years agobpo-22859: deprecate unittest.main.TestProgram.usageExit (GH-30293)
Carlos Damazio [Thu, 17 Mar 2022 02:41:02 +0000 (23:41 -0300)] 
bpo-22859: deprecate unittest.main.TestProgram.usageExit (GH-30293)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agobpo-47039: Normalize repr() of asyncio future and task objects (GH-31950)
Andrew Svetlov [Thu, 17 Mar 2022 01:03:09 +0000 (03:03 +0200)] 
bpo-47039: Normalize repr() of asyncio future and task objects (GH-31950)

3 years agobpo-47038: Increase a test timeout for slow CI machines (GH-31951)
Andrew Svetlov [Thu, 17 Mar 2022 00:54:36 +0000 (02:54 +0200)] 
bpo-47038: Increase a test timeout for slow CI machines (GH-31951)

3 years agobpo-47038: Rewrite missed asyncio.wait_for test to use IsolatedAnsyncioTestCase ...
Andrew Svetlov [Wed, 16 Mar 2022 23:20:29 +0000 (01:20 +0200)] 
bpo-47038: Rewrite missed asyncio.wait_for test to use IsolatedAnsyncioTestCase (GH-31946)

3 years agobpo-47038: Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase (GH-31942)
Andrew Svetlov [Wed, 16 Mar 2022 19:49:18 +0000 (21:49 +0200)] 
bpo-47038: Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase (GH-31942)

3 years agobpo-45979: Fix Tkinter tests with old Tk (>= 8.5.12) (GH-31938)
Serhiy Storchaka [Wed, 16 Mar 2022 17:39:00 +0000 (19:39 +0200)] 
bpo-45979: Fix Tkinter tests with old Tk (>= 8.5.12) (GH-31938)

3 years agobpo-46769: Improve documentation for `typing.TypeVar` (GH-31712)
Alex Waygood [Wed, 16 Mar 2022 15:51:26 +0000 (15:51 +0000)] 
bpo-46769: Improve documentation for `typing.TypeVar` (GH-31712)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agoFix some Windows release build script issues (GH-31931)
Steve Dower [Wed, 16 Mar 2022 15:23:35 +0000 (15:23 +0000)] 
Fix some Windows release build script issues (GH-31931)

* Fix the condition used when excluding ARM64 packages from publish
* Do not publish anything unless the traditional installer works
* Fix disabling of MSI build
* Add override conditions for publish steps
* Allow overriding the Nuget version number during build

3 years agoRewrite asyncio.Queue tests with IsolatedAsyncioTestCace (#31935)
Andrew Svetlov [Wed, 16 Mar 2022 14:59:12 +0000 (16:59 +0200)] 
Rewrite asyncio.Queue tests with IsolatedAsyncioTestCace (#31935)

3 years agobpo-47032: Ensure Windows install builds fail correctly with a non-zero exit code...
Steve Dower [Wed, 16 Mar 2022 01:36:20 +0000 (01:36 +0000)] 
bpo-47032: Ensure Windows install builds fail correctly with a non-zero exit code when part of the build fails (GH-31921)

3 years agobpo-46948: Fix launcher installer build failure due to first part of fix (GH-31920)
Steve Dower [Wed, 16 Mar 2022 00:46:33 +0000 (00:46 +0000)] 
bpo-46948: Fix launcher installer build failure due to first part of fix (GH-31920)

3 years agoIn Windows release builds, do not attempt to copy Tcl/Tk for ARM64 when it is not...
Steve Dower [Wed, 16 Mar 2022 00:44:17 +0000 (00:44 +0000)] 
In Windows release builds, do not attempt to copy Tcl/Tk for ARM64 when it is not being published (GH-31918)

3 years agobpo-46841: Don't scan backwards in bytecode (GH-31901)
Mark Shannon [Wed, 16 Mar 2022 00:08:37 +0000 (00:08 +0000)] 
bpo-46841: Don't scan backwards in bytecode (GH-31901)

3 years agobpo-40280: Detect presence of time.tzset and thread_time clock (GH-31898)
Christian Heimes [Tue, 15 Mar 2022 20:55:35 +0000 (22:55 +0200)] 
bpo-40280: Detect presence of time.tzset and thread_time clock (GH-31898)

3 years agobpo-47024: Update OpenSSL to 1.1.1n (GH-31895)
Christian Heimes [Tue, 15 Mar 2022 20:03:04 +0000 (22:03 +0200)] 
bpo-47024: Update OpenSSL to 1.1.1n (GH-31895)

Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
3 years agobpo-45923: Decouple suspension of tracing from tracing flag. (GH-31908)
Mark Shannon [Tue, 15 Mar 2022 17:06:21 +0000 (17:06 +0000)] 
bpo-45923: Decouple suspension of tracing from tracing flag. (GH-31908)

3 years agobpo-46907: Update Windows installer to SQLite 3.38.1. (GH-31655)
Mariusz Felisiak [Tue, 15 Mar 2022 16:55:10 +0000 (17:55 +0100)] 
bpo-46907: Update Windows installer to SQLite 3.38.1. (GH-31655)

3 years agobpo-40280: Skip wakeup_fd pipe tests on Emscripten (GH-31909)
Christian Heimes [Tue, 15 Mar 2022 16:14:15 +0000 (18:14 +0200)] 
bpo-40280: Skip wakeup_fd pipe tests on Emscripten (GH-31909)

3 years agobpo-46907: Update macOS installer to SQLite 3.38.1. (GH-31656)
Mariusz Felisiak [Tue, 15 Mar 2022 15:04:41 +0000 (16:04 +0100)] 
bpo-46907: Update macOS installer to SQLite 3.38.1. (GH-31656)

3 years agobpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)
Maximilian Hils [Tue, 15 Mar 2022 14:59:02 +0000 (15:59 +0100)] 
bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)

3 years agobpo-46993: Speed up bytearray creation from list and tuple (GH-31834)
Kumar Aditya [Tue, 15 Mar 2022 13:27:30 +0000 (18:57 +0530)] 
bpo-46993: Speed up bytearray creation from list and tuple (GH-31834)

3 years agobpo-20392: Fix inconsistency with uppercase file extensions in mimetypes.guess_type...
Kumar Aditya [Tue, 15 Mar 2022 13:25:43 +0000 (18:55 +0530)] 
bpo-20392: Fix inconsistency with uppercase file extensions in mimetypes.guess_type (GH-30229)

3 years ago Drop accidentally added whitespaces in asyncio internals (GH-31900)
Andrew Svetlov [Tue, 15 Mar 2022 13:22:26 +0000 (15:22 +0200)] 
 Drop accidentally added whitespaces in asyncio internals (GH-31900)

3 years agobpo-46587: Skip tests if strftime does not support glibc extension (GH-31873)
Christian Heimes [Tue, 15 Mar 2022 09:41:04 +0000 (11:41 +0200)] 
bpo-46587: Skip tests if strftime does not support glibc extension (GH-31873)

Co-authored-by: Victor Stinner <vstinner@python.org>
3 years agobpo-46557: Log captured warnings without format string (GH-30975)
Michael P. Nitowski [Tue, 15 Mar 2022 09:01:03 +0000 (05:01 -0400)] 
bpo-46557: Log captured warnings without format string (GH-30975)

3 years agoBut Add missing newline to NEWS entry (GH-31893)
Hugo van Kemenade [Tue, 15 Mar 2022 08:29:10 +0000 (10:29 +0200)] 
But Add missing newline to NEWS entry (GH-31893)

3 years agoTools/gdb: Drop code to support Python 2. (GH-31717)
Inada Naoki [Tue, 15 Mar 2022 08:04:11 +0000 (17:04 +0900)] 
Tools/gdb: Drop code to support Python 2. (GH-31717)

3 years agobpo-43721: Fix docstrings for property.getter/setter/deleter (GH-31046)
Irit Katriel [Mon, 14 Mar 2022 23:28:54 +0000 (23:28 +0000)] 
bpo-43721: Fix docstrings for property.getter/setter/deleter (GH-31046)

3 years agoRevert "bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)" (GH-31879)
Ned Deily [Mon, 14 Mar 2022 20:30:46 +0000 (16:30 -0400)] 
Revert "bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)" (GH-31879)

This reverts commit c99ac3c364ee21be72263791b71ee8b55f64de08
as it breaks test_bdb and test_distutils with installed Pythons.

3 years agobpo-30677: [doc] mention that os.mkdir() can raise FileNotFoundError (GH-31548)
slateny [Mon, 14 Mar 2022 19:57:10 +0000 (12:57 -0700)] 
bpo-30677: [doc] mention that os.mkdir() can raise FileNotFoundError (GH-31548)

3 years agogit ignore Lib/site-packages (GH-31862)
Dennis Sweeney [Mon, 14 Mar 2022 18:53:41 +0000 (14:53 -0400)] 
git ignore Lib/site-packages (GH-31862)

3 years agobpo-31415: importtime was made by Inada Naoki (GH-31875)
Victor Stinner [Mon, 14 Mar 2022 17:39:33 +0000 (18:39 +0100)] 
bpo-31415: importtime was made by Inada Naoki (GH-31875)

3 years agobpo-46920: Remove code that has explainers why it was disabled (GH-31813)
Oleg Iarygin [Mon, 14 Mar 2022 16:04:22 +0000 (19:04 +0300)] 
bpo-46920: Remove code that has explainers why it was disabled (GH-31813)

3 years ago bpo-46920: Remove disabled debug code added decades ago and likely unnecessary ...
Oleg Iarygin [Mon, 14 Mar 2022 16:03:21 +0000 (19:03 +0300)] 
 bpo-46920: Remove disabled debug code added decades ago and likely unnecessary (GH-31812)

3 years agobpo-46920: Remove code that has no explainer why it was disabled (GH-31814)
Oleg Iarygin [Mon, 14 Mar 2022 16:02:32 +0000 (19:02 +0300)] 
bpo-46920: Remove code that has no explainer why it was disabled (GH-31814)

3 years agobpo-46906: Mention native endian in PyFloat_Pack8() doc (GH-31866)
Victor Stinner [Mon, 14 Mar 2022 15:51:51 +0000 (16:51 +0100)] 
bpo-46906: Mention native endian in PyFloat_Pack8() doc (GH-31866)

3 years agobpo-40280: select: Use NULL for empty fdset (GH-31865)
Christian Heimes [Mon, 14 Mar 2022 13:40:28 +0000 (15:40 +0200)] 
bpo-40280: select: Use NULL for empty fdset (GH-31865)

wasm32-emscripten does not support exceptfds and requires NULL. Python
now passes NULL instead of a fdset pointer when the input list is empty.
This works fine on all platforms and might even be a tiny bit faster.

3 years agoCI: Fix patchcheck (GH-31708)
Hugo van Kemenade [Mon, 14 Mar 2022 13:28:57 +0000 (15:28 +0200)] 
CI: Fix patchcheck (GH-31708)

3 years agobpo-46987: Remove _PySys_GetObjectId / _PySys_GetObjectId (GH-31835)
Dong-hee Na [Mon, 14 Mar 2022 12:48:00 +0000 (21:48 +0900)] 
bpo-46987: Remove _PySys_GetObjectId / _PySys_GetObjectId (GH-31835)

3 years agobpo-46994: Accept explicit contextvars.Context in asyncio create_task() API (GH-31837)
Andrew Svetlov [Mon, 14 Mar 2022 11:54:13 +0000 (13:54 +0200)] 
bpo-46994: Accept explicit contextvars.Context in asyncio create_task() API (GH-31837)

3 years agobpo-39829: Fix `__len__()` is called twice in list() constructor (GH-31816)
Crowthebird [Mon, 14 Mar 2022 01:23:59 +0000 (09:23 +0800)] 
bpo-39829: Fix `__len__()` is called twice in list() constructor (GH-31816)

3 years agobpo-47003: Cleanup _overlapped module (GH-31848)
Andrew Svetlov [Sun, 13 Mar 2022 21:28:45 +0000 (23:28 +0200)] 
bpo-47003: Cleanup _overlapped module (GH-31848)

3 years agobpo-47004: Sync with importlib_metadata 4.11.3. (#31854)
Jason R. Coombs [Sun, 13 Mar 2022 19:53:29 +0000 (15:53 -0400)] 
bpo-47004: Sync with importlib_metadata 4.11.3. (#31854)

3 years agobpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)
Pradyun Gedam [Sun, 13 Mar 2022 18:49:28 +0000 (18:49 +0000)] 
bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)

3 years agobpo-46985: Upgrade bundled pip to 22.0.4 (GH-31819)
Pradyun Gedam [Sun, 13 Mar 2022 18:14:20 +0000 (18:14 +0000)] 
bpo-46985: Upgrade bundled pip to 22.0.4 (GH-31819)

3 years agobpo-46805: Add low level UDP socket functions to asyncio (GH-31455)
Alex Grönholm [Sun, 13 Mar 2022 16:42:29 +0000 (18:42 +0200)] 
bpo-46805: Add low level UDP socket functions to asyncio (GH-31455)

3 years agobpo-46995: Deprecate missing asyncio.Task.set_name() for third-party task implementat...
Andrew Svetlov [Sun, 13 Mar 2022 16:34:46 +0000 (18:34 +0200)] 
bpo-46995: Deprecate missing asyncio.Task.set_name() for third-party task implementations (GH-31838)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
3 years agobpo-43215: Document Happy Eyeballs args of asyncio.open_connection (GH-24525)
Illia Volochii [Sat, 12 Mar 2022 23:54:59 +0000 (01:54 +0200)] 
bpo-43215: Document Happy Eyeballs args of asyncio.open_connection (GH-24525)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agobpo-37529: Add test for guessing extensions (GH-28243)
andrei kulakov [Sat, 12 Mar 2022 17:26:17 +0000 (12:26 -0500)] 
bpo-37529: Add test for guessing extensions (GH-28243)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agobpo-43224: Implement PEP 646 changes to genericaliasobject.c (GH-31019)
Matthew Rahtz [Sat, 12 Mar 2022 12:20:12 +0000 (12:20 +0000)] 
bpo-43224: Implement PEP 646 changes to genericaliasobject.c (GH-31019)

Specifically, prepare for starring of tuples via a new genericalias iter type. GenericAlias also partially supports the iterator protocol after this change.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
3 years agobpo-46644: Fix test_typing test broken by GH-31151 due to a merge race (GH-31833)
Jelle Zijlstra [Sat, 12 Mar 2022 02:17:45 +0000 (18:17 -0800)] 
bpo-46644: Fix test_typing test broken by GH-31151 due to a merge race (GH-31833)

3 years agobpo-46644: Remove callable() requirement from typing._type_check (GH-31151)
Gregory Beauregard [Sat, 12 Mar 2022 01:12:17 +0000 (17:12 -0800)] 
bpo-46644: Remove callable() requirement from typing._type_check (GH-31151)

We also remove all the tests that check for integer literals.

3 years agobpo-46841: Add a _Py_SET_OPCODE macro (GH-31780)
Brandt Bucher [Sat, 12 Mar 2022 00:31:50 +0000 (16:31 -0800)] 
bpo-46841: Add a _Py_SET_OPCODE macro (GH-31780)

3 years agobpo-46906: Add PyFloat_Pack8() to the C API (GH-31657)
Victor Stinner [Fri, 11 Mar 2022 23:10:02 +0000 (00:10 +0100)] 
bpo-46906: Add PyFloat_Pack8() to the C API (GH-31657)

Add new functions to pack and unpack C double (serialize and
deserialize):

* PyFloat_Pack2(), PyFloat_Pack4(), PyFloat_Pack8()
* PyFloat_Unpack2(), PyFloat_Unpack4(), PyFloat_Unpack8()

Document these functions and add unit tests.

Rename private functions and move them from the internal C API
to the public C API:

* _PyFloat_Pack2() => PyFloat_Pack2()
* _PyFloat_Pack4() => PyFloat_Pack4()
* _PyFloat_Pack8() => PyFloat_Pack8()
* _PyFloat_Unpack2() => PyFloat_Unpack2()
* _PyFloat_Unpack4() => PyFloat_Unpack4()
* _PyFloat_Unpack8() => PyFloat_Unpack8()

Replace the "unsigned char*" type with "char*" which is more common
and easy to use.

3 years agobpo-40280: Disable AF_UNIX, AF_PACKET, SO_REUSE* on Emscripten (#31829)
Christian Heimes [Fri, 11 Mar 2022 22:25:14 +0000 (00:25 +0200)] 
bpo-40280: Disable AF_UNIX, AF_PACKET, SO_REUSE* on Emscripten (#31829)

Emscripten's socket emulation is limited. AF_UNIX, AF_PACKET, setsockopt(), and most SO_* constants are not supported.

3 years agobpo-46968: Fix faulthandler for Sapphire Rapids Xeon (GH-31789)
Oleksandr Pavlyk [Fri, 11 Mar 2022 22:19:35 +0000 (16:19 -0600)] 
bpo-46968: Fix faulthandler for Sapphire Rapids Xeon (GH-31789)

In Linux kernel 5.14 one can dynamically request size of altstacksize
based on hardware capabilities with getauxval(AT_MINSIGSTKSZ).

This changes allows for Python extension's request to Linux kernel
to use AMX_TILE instruction set on Sapphire Rapids Xeon processor
to succeed, unblocking use of the ISA in frameworks.

Introduced HAVE_LINUX_AUXVEC_H in configure.ac and pyconfig.h.in
Used cpython_autoconf:269 docker container to generate configure.

3 years agobpo-46968: Add os.sysconf_names['SC_MINSIGSTKSZ'] (GH-31824)
Victor Stinner [Fri, 11 Mar 2022 22:01:40 +0000 (23:01 +0100)] 
bpo-46968: Add os.sysconf_names['SC_MINSIGSTKSZ'] (GH-31824)

3 years agobpo-43224: Implement substitution of unpacked TypeVarTuple (GH-31800)
Serhiy Storchaka [Fri, 11 Mar 2022 19:43:58 +0000 (21:43 +0200)] 
bpo-43224: Implement substitution of unpacked TypeVarTuple (GH-31800)

3 years agobpo-31327: Update time documentation to reflect possible errors (GH-31460)
slateny [Fri, 11 Mar 2022 19:05:51 +0000 (11:05 -0800)] 
bpo-31327: Update time documentation to reflect possible errors (GH-31460)

As per the comments, this mirrors the [datetime documentation](https://docs.python.org/3/library/datetime.html#datetime.datetime.fromtimestamp).

```
>>> import time
>>> time.localtime(999999999999999999999)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: timestamp out of range for platform time_t
>>> time.localtime(-3600)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument
```

3 years agoUse FASTCALL for __import__ (GH-31752)
Kumar Aditya [Fri, 11 Mar 2022 16:46:55 +0000 (22:16 +0530)] 
Use FASTCALL for __import__ (GH-31752)

3 years agoRemove an old, elementtree-specific leak detector (GH-31811)
Oleg Iarygin [Fri, 11 Mar 2022 14:47:42 +0000 (17:47 +0300)] 
Remove an old, elementtree-specific leak detector (GH-31811)

3 years agobpo-46944: use FASTCALL calling convention in generator.throw (GH-31723)
Kumar Aditya [Fri, 11 Mar 2022 14:37:14 +0000 (20:07 +0530)] 
bpo-46944: use FASTCALL calling convention in generator.throw (GH-31723)

3 years agoUpdate adaptive.md for inline caching (GH-31817)
Mark Shannon [Fri, 11 Mar 2022 14:29:10 +0000 (14:29 +0000)] 
Update adaptive.md for inline caching (GH-31817)

3 years agobpo-46881: Fix refleak from GH-31616 (GH-31805)
Jelle Zijlstra [Fri, 11 Mar 2022 09:05:08 +0000 (01:05 -0800)] 
bpo-46881: Fix refleak from GH-31616 (GH-31805)

3 years agobpo-44796: Unify TypeVar and ParamSpec substitution (GH-31143)
Serhiy Storchaka [Fri, 11 Mar 2022 08:47:26 +0000 (10:47 +0200)] 
bpo-44796: Unify TypeVar and ParamSpec substitution (GH-31143)

Add methods __typing_subst__() in TypeVar and ParamSpec.
Simplify code by using more object-oriented approach, especially
the C code for types.GenericAlias and the Python code for
collections.abc.Callable.

3 years agosqlite3: normalise pre-acronym determiners (GH-31772)
Erlend Egeberg Aasland [Fri, 11 Mar 2022 01:52:47 +0000 (02:52 +0100)] 
sqlite3: normalise pre-acronym determiners (GH-31772)

For consistency, replace "a SQL" with "an SQL".

3 years agobpo-46198: Fix `test_asyncio.test_sslproto` (GH-31801)
Alex Waygood [Thu, 10 Mar 2022 21:36:22 +0000 (21:36 +0000)] 
bpo-46198: Fix `test_asyncio.test_sslproto` (GH-31801)

GH-30297 removed a duplicate `from test import support` statement from `test_asyncio.test_sslproto`. However, in between that PR being filed and it being merged, GH-31275 removed the _other_ `from test import support` statement. This means that `support` is now undefined in `test_asyncio.test_sslproto`, causing the CI to fail on all platforms for all PRS.

3 years agobpo-46973: Add regen-configure make target (GH-31792)
Christian Heimes [Thu, 10 Mar 2022 17:03:27 +0000 (19:03 +0200)] 
bpo-46973: Add regen-configure make target (GH-31792)

3 years agoRemove print race from task_done example. (GH-31795)
Raymond Hettinger [Thu, 10 Mar 2022 17:01:23 +0000 (11:01 -0600)] 
Remove print race from task_done example. (GH-31795)

3 years agobpo-46917: math.nan is now always available (GH-31793)
Victor Stinner [Thu, 10 Mar 2022 16:47:18 +0000 (17:47 +0100)] 
bpo-46917: math.nan is now always available (GH-31793)

3 years agobpo-46677: Add examples of inheritance and attributes to `TypedDict` docs (GH-31349)
Charlie Zhao [Thu, 10 Mar 2022 16:40:54 +0000 (00:40 +0800)] 
bpo-46677: Add examples of inheritance and attributes to `TypedDict` docs (GH-31349)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agobpo-46198: rename duplicate tests and remove unused code (GH-30297)
Nikita Sobolev [Thu, 10 Mar 2022 16:20:11 +0000 (19:20 +0300)] 
bpo-46198: rename duplicate tests and remove unused code (GH-30297)

3 years agobpo-46771: Implement asyncio context managers for handling timeouts (GH-31394)
Andrew Svetlov [Thu, 10 Mar 2022 16:05:20 +0000 (18:05 +0200)] 
bpo-46771: Implement asyncio context managers for handling timeouts (GH-31394)

Example:

async with asyncio.timeout(5):
    await some_task()

Will interrupt the await and raise TimeoutError if some_task() takes longer than 5 seconds.

Co-authored-by: Guido van Rossum <guido@python.org>
3 years agobpo-46581: Propagate private vars via _GenericAlias.copy_with (GH-31061)
Matt Bogosian [Thu, 10 Mar 2022 14:42:15 +0000 (08:42 -0600)] 
bpo-46581: Propagate private vars via _GenericAlias.copy_with (GH-31061)

GH-26091 added the _typevar_types and _paramspec_tvars instance
variables to _GenericAlias. However, they were not propagated
consistently. This commit addresses the most prominent deficiency
identified in bpo-46581 (namely their absence from
_GenericAlias.copy_with), but there could be others.

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
3 years agobpo-46917: Require IEEE 754 to build Python (GH-31790)
Victor Stinner [Thu, 10 Mar 2022 13:37:19 +0000 (14:37 +0100)] 
bpo-46917: Require IEEE 754 to build Python (GH-31790)

Building Python now requires support of IEEE 754 floating point
numbers.

3 years agobpo-40280: Skip more tests/features that don't apply to Emscripten (GH-31791)
Christian Heimes [Thu, 10 Mar 2022 12:43:40 +0000 (14:43 +0200)] 
bpo-40280: Skip more tests/features that don't apply to Emscripten (GH-31791)

- fd inheritance can't be modified because Emscripten doesn't support subprocesses anyway.
- setpriority always fails
- geteuid no longer causes problems with latest emsdk
- umask is a stub
- geteuid / getuid always return 0, but process cannot chown to random uid.

3 years agobpo-46881: Statically allocate and initialize the latin1 characters. (GH-31616)
Kumar Aditya [Wed, 9 Mar 2022 23:02:00 +0000 (04:32 +0530)] 
bpo-46881: Statically allocate and initialize the latin1 characters. (GH-31616)

3 years agobpo-45138: Revert GH-28240: Expand traced SQL statements (GH-31788)
Erlend Egeberg Aasland [Wed, 9 Mar 2022 17:39:49 +0000 (18:39 +0100)] 
bpo-45138: Revert GH-28240: Expand traced SQL statements (GH-31788)

This reverts commit d1777515f9f53b452a4231d68196a7c0e5deb879.

Automerge-Triggered-By: GH:JelleZijlstra
3 years agobpo-40059: Fix installation of tomllib (GH-31784)
Dominic Davis-Foster [Wed, 9 Mar 2022 13:38:00 +0000 (13:38 +0000)] 
bpo-40059: Fix installation of tomllib (GH-31784)

3 years agobpo-46245: Add optional parameter dir_fd in shutil.rmtree() (GH-30365)
Serhiy Storchaka [Wed, 9 Mar 2022 12:29:33 +0000 (14:29 +0200)] 
bpo-46245: Add optional parameter dir_fd in shutil.rmtree() (GH-30365)

3 years agoFix 3.11 what's new formatting (GH-31763)
Ken Jin [Wed, 9 Mar 2022 11:31:56 +0000 (19:31 +0800)] 
Fix 3.11 what's new formatting (GH-31763)

3 years agobpo-45138: Expand traced SQL statements in `sqlite3` trace callback (GH-28240)
Erlend Egeberg Aasland [Wed, 9 Mar 2022 02:46:40 +0000 (03:46 +0100)] 
bpo-45138: Expand traced SQL statements in `sqlite3` trace callback (GH-28240)

3 years agoDocstring: replace pysqlite with sqlite3 (GH-31758)
Erlend Egeberg Aasland [Wed, 9 Mar 2022 02:45:48 +0000 (03:45 +0100)] 
Docstring: replace pysqlite with sqlite3 (GH-31758)

Replace two instances of "pysqlite" with "sqlite3" in sqlite3
docstrings. Also reword "is a no-op" to "does nothing" for clarity.

3 years agobpo-40280: Skip dysfunctional pipe tests on Emscripten (GH-31770)
Christian Heimes [Tue, 8 Mar 2022 22:15:26 +0000 (00:15 +0200)] 
bpo-40280: Skip dysfunctional pipe tests on Emscripten (GH-31770)

3 years agobpo-24959: fix unittest.assertRaises bug where traceback entries are dropped from...
Irit Katriel [Tue, 8 Mar 2022 21:43:49 +0000 (21:43 +0000)] 
bpo-24959: fix unittest.assertRaises bug where traceback entries are dropped from chained exceptions (GH-23688)

3 years agobpo-46955: Expose asyncio.base_events.Server as asyncio.Server (GH-31760)
Stefan Zabka [Tue, 8 Mar 2022 21:07:33 +0000 (22:07 +0100)] 
bpo-46955: Expose asyncio.base_events.Server as asyncio.Server (GH-31760)

This change aligns the documentation at https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.Server
with the actual implementation

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agobpo-23325: Fix SIG_IGN and SIG_DFL int comparison in signal module (GH-31759)
Christian Heimes [Tue, 8 Mar 2022 18:22:32 +0000 (20:22 +0200)] 
bpo-23325: Fix SIG_IGN and SIG_DFL int comparison in signal module (GH-31759)

3 years agobpo-46841: Don't use an oparg counter for `STORE_SUBSCR` (GH-31742)
Brandt Bucher [Tue, 8 Mar 2022 15:53:22 +0000 (07:53 -0800)] 
bpo-46841: Don't use an oparg counter for `STORE_SUBSCR` (GH-31742)

3 years agoRemoved confusing reference to sys (GH-31638)
David Gilbertson [Tue, 8 Mar 2022 15:43:27 +0000 (02:43 +1100)] 
Removed confusing reference to sys (GH-31638)

3 years agobpo-40280: Block more non-working syscalls in Emscripten (GH-31757)
Christian Heimes [Tue, 8 Mar 2022 11:17:30 +0000 (13:17 +0200)] 
bpo-40280: Block more non-working syscalls in Emscripten (GH-31757)

- getgroups always fails.
- geteuid and getegid always return 0 (root), which confuse tarfile and
  tests.
- hardlinks (link, linkat) always fails.
- non-encodable file names are not supported by NODERAWFS layer.
- mark more tests with dependency on subprocess and multiprocessing.
  Mocking does not work if the module fails to import.

3 years agobpo-44439: _ZipWriteFile.write() handle buffer protocol correctly (GH-29468)
Ma Lin [Tue, 8 Mar 2022 09:33:56 +0000 (17:33 +0800)] 
bpo-44439: _ZipWriteFile.write() handle buffer protocol correctly (GH-29468)

Co-authored-by: Marco Ribeiro <marcoffee@users.noreply.github.com>
3 years agobpo-40059: Add tomllib (PEP-680) (GH-31498)
Taneli Hukkinen [Tue, 8 Mar 2022 08:26:13 +0000 (10:26 +0200)] 
bpo-40059: Add tomllib (PEP-680) (GH-31498)

This adds a new standard library module, `tomllib`, for parsing TOML.

The implementation is based on Tomli (https://github.com/hukkin/tomli).

## Steps taken (converting `tomli` to `tomllib`)

- Move everything in `tomli:src/tomli` to `Lib/tomllib`. Exclude `py.typed`.
- Remove `__version__ = ...` line from `Lib/tomllib/__init__.py`
- Move everything in `tomli:tests` to `Lib/test/test_tomllib`. Exclude the following test data dirs recursively:
  - `tomli:tests/data/invalid/_external/`
  - `tomli:tests/data/valid/_external/`
- Create `Lib/test/test_tomllib/__main__.py`:

  ```python
  import unittest

  from . import load_tests

  unittest.main()
  ```

- Add the following to `Lib/test/test_tomllib/__init__.py`:

  ```python
  import os
  from test.support import load_package_tests

  def load_tests(*args):
      return load_package_tests(os.path.dirname(__file__), *args)
  ```

  Also change `import tomli as tomllib` to `import tomllib`.

- In `cpython/Lib/tomllib/_parser.py` replace `__fp` with `fp` and `__s` with
  `s`. Add the `/` to `load` and `loads` function signatures.

- Run `make regen-stdlib-module-names`

- Create `Doc/library/tomllib.rst` and reference it in `Doc/library/fileformats.rst`

3 years agobpo-46878: Purge 'non-standard' from sqlite3 docstrings (GH-31612)
Erlend Egeberg Aasland [Tue, 8 Mar 2022 04:18:41 +0000 (05:18 +0100)] 
bpo-46878: Purge 'non-standard' from sqlite3 docstrings (GH-31612)

3 years agodocs: Don't use code formatting for emphasis (GH-30519)
William Andrea [Tue, 8 Mar 2022 04:14:47 +0000 (23:14 -0500)] 
docs: Don't use code formatting for emphasis (GH-30519)