]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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)

3 years agoRemoved ambiguity in __init_subclass__ docs (GH-31540)
David Gilbertson [Tue, 8 Mar 2022 04:13:01 +0000 (15:13 +1100)] 
Removed ambiguity in __init_subclass__ docs (GH-31540)

3 years agobpo-46494: Mention the typing_extensions pkg in typing docs (GH-31260)
Meer Suri [Tue, 8 Mar 2022 04:04:04 +0000 (12:04 +0800)] 
bpo-46494: Mention the typing_extensions pkg in typing docs (GH-31260)

3 years agobpo-43224: Implement PEP 646 changes to typing.py (GH-31021)
Matthew Rahtz [Tue, 8 Mar 2022 04:02:55 +0000 (04:02 +0000)] 
bpo-43224: Implement PEP 646 changes to typing.py (GH-31021)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agoimportlib.metadata: Remove empty footnote section (GH-30451)
Ned Batchelder [Tue, 8 Mar 2022 03:55:41 +0000 (19:55 -0800)] 
importlib.metadata: Remove empty footnote section (GH-30451)

3 years agobpo-46170: Improve the error message when subclassing NewType (GH-30268)
James Hilton-Balfe [Tue, 8 Mar 2022 03:50:46 +0000 (03:50 +0000)] 
bpo-46170: Improve the error message when subclassing NewType (GH-30268)

Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
3 years agobpo-45680: Improve docs on subscriptions w.r.t. `GenericAlias` objects (GH-29479)
Alex Waygood [Tue, 8 Mar 2022 03:49:28 +0000 (03:49 +0000)] 
bpo-45680: Improve docs on subscriptions w.r.t. `GenericAlias` objects (GH-29479)

3 years agobpo-46933: Fix make distclean regression (GH-31737)
Erlend Egeberg Aasland [Mon, 7 Mar 2022 22:18:54 +0000 (23:18 +0100)] 
bpo-46933: Fix make distclean regression (GH-31737)

3 years agobpo-46932: Update bundled libexpat to 2.4.7 (GH-31736)
Steve Dower [Mon, 7 Mar 2022 21:46:18 +0000 (21:46 +0000)] 
bpo-46932: Update bundled libexpat to 2.4.7 (GH-31736)

3 years agobpo-46841: Use inline caching for calls (GH-31709)
Brandt Bucher [Mon, 7 Mar 2022 19:45:00 +0000 (11:45 -0800)] 
bpo-46841: Use inline caching for calls (GH-31709)

3 years agobpo-44549: Update bzip2 to 1.0.8 in Windows builds to mitigate CVE-2016-3189 and...
Steve Dower [Mon, 7 Mar 2022 18:23:29 +0000 (18:23 +0000)] 
bpo-44549: Update bzip2 to 1.0.8 in Windows builds to mitigate CVE-2016-3189 and CVE-2019-12900 (GH-31731)

3 years agoMerge remote-tracking branch 'upstream/main'
Pablo Galindo [Mon, 7 Mar 2022 18:18:37 +0000 (18:18 +0000)] 
Merge remote-tracking branch 'upstream/main'

3 years agoPost 3.11.0a6
Pablo Galindo [Mon, 7 Mar 2022 18:18:09 +0000 (18:18 +0000)] 
Post 3.11.0a6

3 years agobpo-41370: Evaluate strings as forward refs in PEP 585 generics (GH-30900)
Niklas Rosenstein [Mon, 7 Mar 2022 18:02:59 +0000 (19:02 +0100)] 
bpo-41370: Evaluate strings as forward refs in PEP 585 generics (GH-30900)

This removes discrepancy between list["int"] and List["int"].

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
3 years agobpo-46948: Fix CVE-2022-26488 by ensuring the Windows Installer correctly uses the...
Steve Dower [Mon, 7 Mar 2022 17:23:11 +0000 (17:23 +0000)] 
bpo-46948: Fix CVE-2022-26488 by ensuring the Windows Installer correctly uses the install path during repair (GH-31726)

3 years agobpo-46933: Make pwd module optional (GH-31700)
Christian Heimes [Mon, 7 Mar 2022 12:36:47 +0000 (14:36 +0200)] 
bpo-46933: Make pwd module optional (GH-31700)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
3 years agoPython 3.11.0a6 v3.11.0a6
Pablo Galindo [Mon, 7 Mar 2022 12:28:08 +0000 (12:28 +0000)] 
Python 3.11.0a6

3 years agobpo-46940: Don't override existing AttributeError suggestion information (GH-31710)
Pablo Galindo Salgado [Mon, 7 Mar 2022 12:23:11 +0000 (12:23 +0000)] 
bpo-46940: Don't override existing AttributeError suggestion information (GH-31710)

When an exception is created in a nested call to PyObject_GetAttr, any
external calls will override the context information of the
AttributeError that we have already placed in the most internal call.
This will cause the suggestions we create to nor work properly as the
attribute name and object that we will be using are the incorrect ones.

To avoid this, we need to check first if these attributes are already
set and bail out if that's the case.

3 years agobpo-46937: convert remaining functions to AC in _weakref (GH-31705)
Kumar Aditya [Mon, 7 Mar 2022 09:57:45 +0000 (15:27 +0530)] 
bpo-46937: convert remaining functions to AC in _weakref (GH-31705)

3 years agobpo-43292: Fix file leak in `ET.iterparse()` when not exhausted (GH-31696)
Jacob Walls [Mon, 7 Mar 2022 09:31:46 +0000 (04:31 -0500)] 
bpo-43292: Fix file leak in `ET.iterparse()` when not exhausted (GH-31696)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
3 years agoUse assertEqual, not assertEquals, in test_unicode (GH-31718)
Dennis Sweeney [Mon, 7 Mar 2022 07:32:51 +0000 (02:32 -0500)] 
Use assertEqual, not assertEquals, in test_unicode (GH-31718)

Fixes a DeprecationWarning

3 years agoClean up CODEOWNERS (#31715)
Jelle Zijlstra [Mon, 7 Mar 2022 02:04:58 +0000 (18:04 -0800)] 
Clean up CODEOWNERS (#31715)

crypto-team apparently doesn't exist and skrah no longer has write access. Thanks @isidentical for noticing this.

3 years agobpo-45582: Don't fail if ENV_PATH is None in getpath.py (GH-31699)
Christian Heimes [Sun, 6 Mar 2022 19:49:27 +0000 (21:49 +0200)] 
bpo-45582: Don't fail if ENV_PATH is None in getpath.py (GH-31699)

3 years agoUpdate grammar_grapher with the new forced (&&) directive (#31704)
Luca Chiodini [Sun, 6 Mar 2022 14:26:28 +0000 (15:26 +0100)] 
Update grammar_grapher with the new forced (&&) directive (#31704)

3 years agobpo-14156: Make argparse.FileType work correctly for binary file modes when argument...
MojoVampire [Sun, 6 Mar 2022 11:49:42 +0000 (11:49 +0000)] 
bpo-14156: Make argparse.FileType work correctly for binary file modes when argument is '-' (GH-13165)

Also made modes containing 'a' or 'x' act the same as a mode containing 'w' when argument is '-'
(so 'a'/'x' return sys.stdout like 'w', and 'ab'/'xb' return sys.stdout.buffer like 'wb').

3 years agobpo-46921: Vectorcall support for `super()` (GH-31687)
Ken Jin [Sun, 6 Mar 2022 06:21:28 +0000 (14:21 +0800)] 
bpo-46921: Vectorcall support for `super()` (GH-31687)

Co-Authored-By: Dong-hee Na <donghee.na@python.org>
3 years agobpo-46864: Deprecate PyBytesObject.ob_shash. (GH-31598)
Inada Naoki [Sun, 6 Mar 2022 02:39:10 +0000 (11:39 +0900)] 
bpo-46864: Deprecate PyBytesObject.ob_shash. (GH-31598)

3 years agoRemove trailing spaces (GH-31695)
Serhiy Storchaka [Sat, 5 Mar 2022 15:47:00 +0000 (17:47 +0200)] 
Remove trailing spaces (GH-31695)

3 years agobpo-46927: Include the type's name in the error message for subscripting non-generic...
Serhiy Storchaka [Sat, 5 Mar 2022 13:59:24 +0000 (15:59 +0200)] 
bpo-46927: Include the type's name in the error message for subscripting non-generic types (GH-31694)

3 years agoLib/typing.py copy edits originating from GH-31061 (#31684)
Matt Bogosian [Sat, 5 Mar 2022 02:51:55 +0000 (20:51 -0600)] 
Lib/typing.py copy edits originating from GH-31061 (#31684)

3 years agobpo-38738: Fix formatting of True and False in the threading documentation (GH-31678)
Géry Ogam [Fri, 4 Mar 2022 20:13:09 +0000 (21:13 +0100)] 
bpo-38738: Fix formatting of True and False in the threading documentation (GH-31678)

* Fix formatting of True and False in the threading documentation
* Update threading.rst

3 years agobpo-46841: Fix BINARY_OP's handling of inline caches (GH-31671)
Brandt Bucher [Fri, 4 Mar 2022 18:51:27 +0000 (10:51 -0800)] 
bpo-46841: Fix BINARY_OP's handling of inline caches (GH-31671)

3 years agobpo-25415: Remove confusing sentence from IOBase docstrings (PR-31631)
slateny [Fri, 4 Mar 2022 17:35:52 +0000 (09:35 -0800)] 
bpo-25415: Remove confusing sentence from IOBase docstrings (PR-31631)

3 years agobpo-46541: Remove usage of _Py_IDENTIFIER from lzma module (GH-31683)
Dong-hee Na [Fri, 4 Mar 2022 16:38:56 +0000 (01:38 +0900)] 
bpo-46541: Remove usage of _Py_IDENTIFIER from lzma module (GH-31683)

3 years agobpo-46841: Fix error message hacks in `GET_AWAITABLE` (GH-31664)
Brandt Bucher [Fri, 4 Mar 2022 12:41:17 +0000 (04:41 -0800)] 
bpo-46841: Fix error message hacks in `GET_AWAITABLE` (GH-31664)

3 years agobpo-46903: Handle str-subclasses in virtual instance dictionaries. (GH-31658)
Mark Shannon [Fri, 4 Mar 2022 11:31:29 +0000 (11:31 +0000)] 
bpo-46903: Handle str-subclasses in virtual instance dictionaries. (GH-31658)

3 years agobpo-46744: Move Windows ARM64 installation directory to correct ProgramFiles (GH...
Steve Dower [Fri, 4 Mar 2022 00:50:42 +0000 (00:50 +0000)] 
bpo-46744: Move Windows ARM64 installation directory to correct ProgramFiles (GH-31677)

3 years agobpo-46355: Update pythoncapi_compat project URL (GH-31670)
Victor Stinner [Thu, 3 Mar 2022 23:46:56 +0000 (00:46 +0100)] 
bpo-46355: Update pythoncapi_compat project URL (GH-31670)

3 years agobpo-46913: Skip test_ctypes.test_shorts() on UBSan (GH-31674)
Victor Stinner [Thu, 3 Mar 2022 23:41:57 +0000 (00:41 +0100)] 
bpo-46913: Skip test_ctypes.test_shorts() on UBSan (GH-31674)

If Python is built with UBSan, test_ctypes now skips test_shorts().
This change allows to run test_ctypes to check for new UBSan regression,
but the known test_shorts() undefined behavior must be fixed.

3 years agobpo-46913: test_hashlib skips _sha3 tests on UBSan (GH-31673)
Victor Stinner [Thu, 3 Mar 2022 23:41:34 +0000 (00:41 +0100)] 
bpo-46913: test_hashlib skips _sha3 tests on UBSan (GH-31673)

If Python is built with UBSan, test_hashlib skips tests on the _sha3
extension which currently has undefined behaviors.

This change allows to run test_hashlib to check for new UBSan regression,
but the known _sha3 undefined behavior must be fixed.

3 years agobpo-46841: Use inline caching for attribute accesses (GH-31640)
Brandt Bucher [Thu, 3 Mar 2022 23:31:00 +0000 (15:31 -0800)] 
bpo-46841: Use inline caching for attribute accesses (GH-31640)

3 years agobpo-46913: Fix test_faulthandler.test_read_null() on UBSan (GH31672)
Victor Stinner [Thu, 3 Mar 2022 23:25:03 +0000 (00:25 +0100)] 
bpo-46913: Fix test_faulthandler.test_read_null() on UBSan (GH31672)

Disable undefined behavior sanitizer (UBSan) on
faulthandler._read_null().

3 years agobpo-45459: Use type names in the internal C API (GH-31669)
Victor Stinner [Thu, 3 Mar 2022 22:08:07 +0000 (23:08 +0100)] 
bpo-45459: Use type names in the internal C API (GH-31669)

Replace "struct xxx" with "xxx" types in the internal C API.

3 years agobpo-45459: Fix PyModuleDef_Slot type in the limited C API (GH-31668)
Victor Stinner [Thu, 3 Mar 2022 22:06:55 +0000 (23:06 +0100)] 
bpo-45459: Fix PyModuleDef_Slot type in the limited C API (GH-31668)

Move the type definition to pytypedefs.h.

3 years agobpo-46913: Fix test_faulthandler.test_sigfpe() on UBSAN (GH-31662)
Victor Stinner [Thu, 3 Mar 2022 20:45:01 +0000 (21:45 +0100)] 
bpo-46913: Fix test_faulthandler.test_sigfpe() on UBSAN (GH-31662)

Disable undefined behavior sanitizer (UBSAN) on
faulthandler_sigfpe().

3 years agobpo-46841: Improve the failure stats for COMPARE_OP (GH-31663)
Brandt Bucher [Thu, 3 Mar 2022 19:28:47 +0000 (11:28 -0800)] 
bpo-46841: Improve the failure stats for COMPARE_OP (GH-31663)

3 years agobpo-46877: export unittest.doModuleCleanups in unittest package (#31613)
Kumar Aditya [Thu, 3 Mar 2022 18:41:28 +0000 (00:11 +0530)] 
bpo-46877: export unittest.doModuleCleanups in unittest package (#31613)

3 years agoMove check for str-only keys in LOAD_GLOBAL specializations to specialization time...
Mark Shannon [Thu, 3 Mar 2022 15:17:18 +0000 (15:17 +0000)] 
Move check for str-only keys in LOAD_GLOBAL specializations to specialization time. (GH-31659)

3 years agobpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter (GH...
vidhya [Thu, 3 Mar 2022 14:23:47 +0000 (09:23 -0500)] 
bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter (GH-31639)

3 years agobpo-46874: Speed up sqlite3 user-defined aggregate 'step' method (GH-31604)
Erlend Egeberg Aasland [Thu, 3 Mar 2022 13:54:36 +0000 (14:54 +0100)] 
bpo-46874: Speed up sqlite3 user-defined aggregate 'step' method (GH-31604)

3 years agobpo-46891: Fix creating a new instance of a module subclass with slots (GH-31643)
Mark Shannon [Thu, 3 Mar 2022 10:38:27 +0000 (10:38 +0000)] 
bpo-46891: Fix creating a new instance of a module subclass with slots (GH-31643)

3 years agoFix EncodingWarning in libregrtest (GH-31654)
Inada Naoki [Thu, 3 Mar 2022 07:19:56 +0000 (16:19 +0900)] 
Fix EncodingWarning in libregrtest (GH-31654)

3 years agobpo-46831: Update __build_class__ comment (#31522)
Shantanu [Thu, 3 Mar 2022 05:32:57 +0000 (21:32 -0800)] 
bpo-46831: Update __build_class__ comment (#31522)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agodict: Fix refleak (GH-31650)
Inada Naoki [Thu, 3 Mar 2022 05:30:58 +0000 (14:30 +0900)] 
dict: Fix refleak (GH-31650)

3 years agobpo-46643: fix NEWS entry (GH-31651)
Jelle Zijlstra [Thu, 3 Mar 2022 05:27:11 +0000 (21:27 -0800)] 
bpo-46643: fix NEWS entry (GH-31651)

3 years agobpo-40116: dict: Add regression test for iteration order. (GH-31550)
Inada Naoki [Thu, 3 Mar 2022 04:06:29 +0000 (13:06 +0900)] 
bpo-40116: dict: Add regression test for iteration order. (GH-31550)