]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agoPython 3.11.0a5 v3.11.0a5
Pablo Galindo [Thu, 3 Feb 2022 18:34:09 +0000 (18:34 +0000)] 
Python 3.11.0a5

3 years agobpo-46436: Fix command-line option -d/--directory in module http.server (GH-30701)
Géry Ogam [Thu, 3 Feb 2022 15:51:05 +0000 (16:51 +0100)] 
bpo-46436: Fix command-line option -d/--directory in module http.server (GH-30701)

Fix command-line option -d/--directory in http.server main
function that was ignored when combined with --cgi.

Automerge-Triggered-By: GH:merwok
3 years agobpo-46569: [Enum] fix typo in `StrEnum` docs (GH-31007)
Nikita Sobolev [Thu, 3 Feb 2022 15:22:41 +0000 (18:22 +0300)] 
bpo-46569: [Enum] fix typo in `StrEnum` docs (GH-31007)

3 years agobpo-46624: Defer to 3.12: "Remove deprecated support for non-integer values" (GH...
Miro Hrončok [Thu, 3 Feb 2022 13:48:13 +0000 (14:48 +0100)] 
bpo-46624: Defer to 3.12: "Remove deprecated support for non-integer values" (GH-31098)

3 years agobpo-45885: Add more stats for COMPARE_OP in specialize.c (GH-31040)
Dennis Sweeney [Thu, 3 Feb 2022 13:32:52 +0000 (08:32 -0500)] 
bpo-45885: Add more stats for COMPARE_OP in specialize.c (GH-31040)

3 years agobpo-45773: Remove invalid peephole optimizations (GH-31066)
Brandt Bucher [Thu, 3 Feb 2022 10:14:44 +0000 (02:14 -0800)] 
bpo-45773: Remove invalid peephole optimizations (GH-31066)

3 years agobpo-44977: Deprecate delegation of int to __trunc__ (GH-31031)
Zackery Spytz [Thu, 3 Feb 2022 09:43:25 +0000 (01:43 -0800)] 
bpo-44977: Deprecate delegation of int to __trunc__ (GH-31031)

Calling int(a) when type(a) implements __trunc__ but not __int__
or __index__ now raises a DeprecationWarning.

3 years agobpo-46483: Remove `__class_getitem__` from `pathlib.PurePath` (GH-30848)
Nikita Sobolev [Thu, 3 Feb 2022 09:25:10 +0000 (12:25 +0300)] 
bpo-46483: Remove `__class_getitem__` from `pathlib.PurePath` (GH-30848)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
3 years agobpo-46565: `del` loop vars that are leaking into module namespaces (GH-30993)
Nikita Sobolev [Thu, 3 Feb 2022 09:20:08 +0000 (12:20 +0300)] 
bpo-46565: `del` loop vars that are leaking into module namespaces (GH-30993)

3 years agoRestrict use of Mock objects as specs (GH-31090)
Matthew Suozzo [Thu, 3 Feb 2022 08:41:19 +0000 (03:41 -0500)] 
Restrict use of Mock objects as specs (GH-31090)

Follow-on to https://github.com/python/cpython/pull/25326

This covers cases where mock objects are passed directly to spec.

3 years agobpo-45629: Improve test.support.skip_if_buildbot (GH-31094)
Gregory P. Smith [Thu, 3 Feb 2022 05:36:16 +0000 (21:36 -0800)] 
bpo-45629: Improve test.support.skip_if_buildbot (GH-31094)

It was added as part of #29222 to avoid running freeze tool tests on the
buildbots but the logic was wrong so it did not skip tests on typical posix
setup buildbots where the worker is launched from cron via an @reboot task and
thus have no USER environment variable.  This uses the canonical
`getpass.getuser()` API rather than rolling its own attempt.

3 years agobpo-45975: Use walrus operator for some idlelib while loops (GH-31083)
Nick Drozd [Thu, 3 Feb 2022 01:59:24 +0000 (19:59 -0600)] 
bpo-45975: Use walrus operator for some idlelib while loops (GH-31083)

3 years agobpo-46576: bpo-46524: Disable compiler optimization within test_peg_generator. (...
Gregory P. Smith [Wed, 2 Feb 2022 20:15:16 +0000 (12:15 -0800)] 
bpo-46576: bpo-46524: Disable compiler optimization within test_peg_generator. (#31015)

Disable compiler optimization within test_peg_generator.

This speed up test_peg_generator by always disabling compiler
optimizations by using -O0 or equivalent when the test is building its
own C extensions.

A build not using --with-pydebug in order to speed up test execution
winds up with this test taking a very long time as it would do
repeated compilation of parser C code using the same optimization
flags as CPython was built with.

This speeds the test up 6-8x on gps-raspbian.

Also incorporate's #31017's win32 conditional and flags.

Co-authored-by: Kumar Aditya kumaraditya303
3 years agobpo-46616: Ensures test_importlib.test_windows cleans up registry keys after completi...
Steve Dower [Wed, 2 Feb 2022 19:54:27 +0000 (19:54 +0000)] 
bpo-46616: Ensures test_importlib.test_windows cleans up registry keys after completion (GH-31086)

3 years agobpo-45173: Keep configparser deprecations until Python 3.12 (GH-30952)
Hugo van Kemenade [Wed, 2 Feb 2022 16:59:39 +0000 (18:59 +0200)] 
bpo-45173: Keep configparser deprecations until Python 3.12 (GH-30952)

* Revert "bpo-45173 Remove configparser deprecations"

This reverts commit df2284bc416dcccba1125b12af4499c45baabe4f.

* bpo-45173: Note these configparser deprecations will be removed in 3.12

3 years agobpo-37705: Remove orphaned PC/errmap.mak (GH-29724)
Oleg Iarygin [Wed, 2 Feb 2022 16:23:30 +0000 (19:23 +0300)] 
bpo-37705: Remove orphaned PC/errmap.mak (GH-29724)

After GH-15623 deleted `generrmap.c`, a related mak-file stopped working. The mak contains generrmap-related rules only so it should be removed altogether.

Further search for `errmap\.mak|generrmap` regex through content of CPython files shows no dangling reference left.

Since generrmap is already effectively removed, this pull request contains no blurp.

3 years agobpo-46433: _PyType_GetModuleByDef: handle static types in MRO (GH-30696)
Petr Viktorin [Wed, 2 Feb 2022 15:57:51 +0000 (16:57 +0100)] 
bpo-46433: _PyType_GetModuleByDef: handle static types in MRO (GH-30696)

Automerge-Triggered-By: GH:encukou
3 years agoAdd specialization stats for FOR_ITER. (GH-31079)
Mark Shannon [Wed, 2 Feb 2022 15:56:47 +0000 (15:56 +0000)] 
Add specialization stats for FOR_ITER. (GH-31079)

3 years ago bpo-45459: Add Py_buffer to limited API (GH-29991)
Christian Heimes [Wed, 2 Feb 2022 15:03:10 +0000 (17:03 +0200)] 
 bpo-45459: Add Py_buffer to limited API (GH-29991)

- [x] ``Py_buffer`` struct
- [x] ``PyBuffer_*()`` API functions
- [x] ``PyBUF_*`` constants
- [x] ``Py_bf_getbuffer`` and ``Py_bf_releasebuffer`` type slots
- [x] ``PyMemoryView_FromBuffer()`` API
- [x] tests for limited API
- [x] ``make regen-limited-abi``
- [x] documentation update
- [ ] export ``PyPickleBuffer*()`` API ???

3 years agobpo-43012: remove `pathlib._Accessor` (GH-25701)
Barney Gale [Wed, 2 Feb 2022 12:38:25 +0000 (12:38 +0000)] 
bpo-43012: remove `pathlib._Accessor` (GH-25701)

Per Pitrou:

> The original intent for the “accessor” thing was to have a variant that did all accesses under a filesystem tree in a race condition-free way using openat and friends. It turned out to be much too hairy to actually implement, so was entirely abandoned, but the accessor abstraction was left there.

https://discuss.python.org/t/make-pathlib-extensible/3428/2

Accessors are:

- Lacking any internal purpose - '_NormalAccessor' is the only implementation
- Lacking any firm conceptual difference to `Path` objects themselves (inc. subclasses)
- Non-public, i.e. underscore prefixed - '_Accessor' and '_NormalAccessor'
- Unofficially used to implement customized `Path` objects, but once once [bpo-24132]() is addressed there will be a supported route for that.

This patch preserves all existing behaviour.

3 years agobpo-46072: Add some frame stats. (GH-31060)
Mark Shannon [Wed, 2 Feb 2022 11:01:33 +0000 (11:01 +0000)] 
bpo-46072: Add some frame stats. (GH-31060)

3 years agoRemove Python 3.3 compatibility code from overlapped.c (GH-31049)
Kumar Aditya [Wed, 2 Feb 2022 08:16:36 +0000 (13:46 +0530)] 
Remove Python 3.3 compatibility code from overlapped.c (GH-31049)

3 years agobpo-46583: remove unused `sys.version_info` check from `selectors` (GH-31023)
Nikita Sobolev [Wed, 2 Feb 2022 08:15:02 +0000 (11:15 +0300)] 
bpo-46583: remove unused `sys.version_info` check from `selectors` (GH-31023)

3 years agoAdd recipe for subslices (GH-31028)
Raymond Hettinger [Wed, 2 Feb 2022 04:18:52 +0000 (22:18 -0600)] 
Add recipe for subslices (GH-31028)

3 years agoFix minor details in the Counter docs (GH-31029)
Raymond Hettinger [Wed, 2 Feb 2022 04:18:11 +0000 (22:18 -0600)] 
Fix minor details in the Counter docs (GH-31029)

3 years agobpo-46414: Add typing.reveal_type (#30646)
Jelle Zijlstra [Wed, 2 Feb 2022 02:48:55 +0000 (18:48 -0800)] 
bpo-46414: Add typing.reveal_type (#30646)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
3 years agobpo-46602: Do not append conftest.c (GH-31062)
adanhawth [Wed, 2 Feb 2022 02:38:15 +0000 (21:38 -0500)] 
bpo-46602: Do not append conftest.c (GH-31062)

The heredoc creation statements use >> to append conftest.c.  This can cause
tricky build issues if the file is not correctly removed prior to its
name being reused (such name is reused several times for different
contextual tests during the build).  One such result from appending may
cause #include <ac_nonexistent.h> to persist when testing to acquire
PLATFORM_TRIPLET.  This can then lead to downstream issues concerning SOABI.

3 years agobpo-44359: Fix test_ftplib unhandled thread exceptions (GH-31069)
Victor Stinner [Wed, 2 Feb 2022 01:47:40 +0000 (02:47 +0100)] 
bpo-44359: Fix test_ftplib unhandled thread exceptions (GH-31069)

test_ftplib now silently ignores socket errors to prevent logging
unhandled threading exceptions.

3 years agobpo-46591: Make About IDLE doc link label clickable (GH-30251)
Wes [Wed, 2 Feb 2022 01:20:23 +0000 (20:20 -0500)] 
bpo-46591: Make About IDLE doc link label clickable (GH-30251)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
3 years agobpo-14916: use specified tokenizer fd for file input (GH-31006)
Paul m. p. P [Tue, 1 Feb 2022 22:33:52 +0000 (23:33 +0100)] 
bpo-14916: use specified tokenizer fd for file input (GH-31006)

@pablogsal, sorry i failed to rebase to main, so i recreated https://github.com/python/cpython/pull/22190#issuecomment-1024633392

> PyRun_InteractiveOne\*() functions allow to explicitily set fd instead of stdin.
but stdin was hardcoded in readline call.

> This patch does not fix target file for prompt unlike original bpo one : prompt fd is unrelated to tokenizer source which could be read only. It is more of a bugfix regarding the docs :  actual documentation say "prompt the user" so one would expect prompt to go on stdout not a file for both PyRun_InteractiveOne\*() and PyRun_InteractiveLoop\*().

Automerge-Triggered-By: GH:pablogsal
3 years agobpo-46528: Simplify BUILD_TUPLE/UNPACK_SEQUENCE folding (GH-31039)
Brandt Bucher [Tue, 1 Feb 2022 21:41:32 +0000 (13:41 -0800)] 
bpo-46528: Simplify BUILD_TUPLE/UNPACK_SEQUENCE folding (GH-31039)

3 years agobpo-46600: Fix test_gdb.test_pycfunction() for clang -Og (GH-31058)
Victor Stinner [Tue, 1 Feb 2022 17:12:26 +0000 (18:12 +0100)] 
bpo-46600: Fix test_gdb.test_pycfunction() for clang -Og (GH-31058)

Fix test_gdb.test_pycfunction() for Python built with clang -Og.
Tolerate inlined functions in the gdb traceback.

When _testcapimodule.c is built by clang -Og, _null_to_none() is
inlined in meth_varargs() and so gdb returns _null_to_none() as
the frame #1. If it's not inlined, meth_varargs() is the frame #1.

3 years agobpo-45953: Preserve backward compatibility on some PyThreadState field names. (GH...
Eric Snow [Tue, 1 Feb 2022 17:02:25 +0000 (10:02 -0700)] 
bpo-45953: Preserve backward compatibility on some PyThreadState field names. (GH-31038)

The gevent project is using the two `PyThreadState` fields I renamed in gh-30590.  This PR fixes the names.  See #msg412046.

3 years agobpo-46487: Add `get_write_buffer_limits` to Write and _SSLProtocol transports (GH...
Emiya [Tue, 1 Feb 2022 16:05:02 +0000 (21:35 +0530)] 
bpo-46487: Add `get_write_buffer_limits` to Write and _SSLProtocol transports (GH-30958)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 years agobpo-45925: Update macOS installer to SQLite 3.37.2 (GH-30921)
Kumar Aditya [Tue, 1 Feb 2022 15:58:29 +0000 (21:28 +0530)] 
bpo-45925: Update macOS installer to SQLite 3.37.2 (GH-30921)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
3 years agobpo-46072: Add some object layout and allocation stats (GH-31051)
Mark Shannon [Tue, 1 Feb 2022 15:05:18 +0000 (15:05 +0000)] 
bpo-46072: Add some object layout and allocation stats (GH-31051)

3 years agobpo-46584: remove check for `py2.3` from `ctypes/test_python_api` (GH-31024)
Nikita Sobolev [Tue, 1 Feb 2022 13:56:25 +0000 (16:56 +0300)] 
bpo-46584: remove check for `py2.3` from `ctypes/test_python_api` (GH-31024)

3 years agobpo-46600: ./configure --with-pydebug uses -Og with clang (GH-31052)
Victor Stinner [Tue, 1 Feb 2022 13:47:12 +0000 (14:47 +0100)] 
bpo-46600: ./configure --with-pydebug uses -Og with clang (GH-31052)

Fix the test checking if the C compiler supports -Og option in the
./configure script to also use -Og on clang which supports it.

3 years agobpo-46564: do not create frame object for super object (GH-31002)
Kumar Aditya [Tue, 1 Feb 2022 13:40:46 +0000 (19:10 +0530)] 
bpo-46564: do not create frame object for super object (GH-31002)

3 years agobpo-44031: fix test_tabnanny failure in non-ascii CWD (GH-31014)
Irit Katriel [Tue, 1 Feb 2022 10:31:57 +0000 (10:31 +0000)] 
bpo-44031: fix test_tabnanny failure in non-ascii CWD (GH-31014)

3 years agobpo-46355: What's New: Note that PyFrameObject are private (GH-31032)
Petr Viktorin [Tue, 1 Feb 2022 10:22:34 +0000 (11:22 +0100)] 
bpo-46355: What's New: Note that PyFrameObject are private (GH-31032)

This adds a slightly more detailed explanation of the change.
The most important point is that the changed/removed fields
were "subject to change" to begin with.

3 years agobpo-46482: add a test for `typing.Annotation.__new__` (GH-30821)
Nikita Sobolev [Tue, 1 Feb 2022 09:58:41 +0000 (12:58 +0300)] 
bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821)

3 years agobpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035)
Victor Stinner [Mon, 31 Jan 2022 17:46:09 +0000 (18:46 +0100)] 
bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035)

* bpo-46542: test_lib2to3 uses support.infinite_recursion()

Fix a Python crash in test_lib2to3 when using Python built in debug
mode: limit the recursion limit.

The test_all_project_files() test of test_lib2to3 now uses the
test.support.infinite_recursion() context manager when processing the
infinite_recursion.py file to prevent a crash when Python is built in
debug mode.

The two test_all_project_files() tests now use subTest() and log the
refactored/parsed filename (if test_lib2to3 is run in verbose mode).

* Update Lib/lib2to3/tests/data/infinite_recursion.py

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agobpo-46407: Fix long_mod refleak (GH-31025)
Ken Jin [Mon, 31 Jan 2022 10:41:14 +0000 (18:41 +0800)] 
bpo-46407: Fix long_mod refleak (GH-31025)

3 years agofFx refleak in isinstance error path (GH-31005)
Ken Jin [Sat, 29 Jan 2022 14:34:12 +0000 (22:34 +0800)] 
fFx refleak in isinstance error path (GH-31005)

3 years agoFix a `UnboundLocalError` bug in `test_sysconfig` (GH-31000)
Brett Cannon [Sat, 29 Jan 2022 00:43:36 +0000 (16:43 -0800)] 
Fix a `UnboundLocalError` bug in `test_sysconfig` (GH-31000)

Accidentally introduced by GH-24502

3 years agobpo-29688: document and test `pathlib.Path.absolute()` (GH-26153)
Barney Gale [Fri, 28 Jan 2022 23:40:55 +0000 (23:40 +0000)] 
bpo-29688: document and test `pathlib.Path.absolute()` (GH-26153)

Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Brian Helba <brian.helba@kitware.com>
3 years agobpo-43112: detect musl as a separate SOABI (GH-24502)
Natanael Copa [Fri, 28 Jan 2022 23:02:54 +0000 (00:02 +0100)] 
bpo-43112: detect musl as a separate SOABI (GH-24502)

musl libc and gnu libc are not ABI compatible so we need set different
SOABI for musl and not simply assume that all linux is linux-gnu.

Replace linux-gnu with the detected os for the build from config.guess
for linux-musl*.

3 years agobpo-26552: Fixed case where failing `asyncio.ensure_future` did not close the corouti...
Kumar Aditya [Fri, 28 Jan 2022 22:24:35 +0000 (03:54 +0530)] 
bpo-26552: Fixed case where failing `asyncio.ensure_future` did not close the coroutine (#30288)

3 years agobpo-46458: Add tests for context of exception in finally block (GH-30986)
Irit Katriel [Fri, 28 Jan 2022 20:41:58 +0000 (20:41 +0000)] 
bpo-46458: Add tests for context of exception in finally block (GH-30986)

3 years agobpo-46560: Fix a typo in `typing.ParamSpec's` doc string (GH-30995)
Zackery Spytz [Fri, 28 Jan 2022 18:08:11 +0000 (10:08 -0800)] 
bpo-46560: Fix a typo in `typing.ParamSpec's` doc string (GH-30995)

3 years agobpo-46553: allow bare typing.ClassVar annotations (#30983)
Gregory Beauregard [Fri, 28 Jan 2022 16:58:39 +0000 (08:58 -0800)] 
bpo-46553: allow bare typing.ClassVar annotations (#30983)

These are used in the wild and covered by dataclasses unit tests.
Several static type checkers support this pattern.

3 years agobpo-33125: Enables building traditional installer for Windows ARM64 (GH-30885)
Steve Dower [Fri, 28 Jan 2022 16:48:06 +0000 (16:48 +0000)] 
bpo-33125: Enables building traditional installer for Windows ARM64 (GH-30885)

Also makes a few general improvements to the build process and removes some dead code.

3 years agobpo-45925: Update Windows installer to SQLite 3.37.2 (GH-30485)
Kumar Aditya [Fri, 28 Jan 2022 16:29:32 +0000 (21:59 +0530)] 
bpo-45925: Update Windows installer to SQLite 3.37.2 (GH-30485)

3 years agobpo-46072: Add simple stats for Python calls. (GH-30989)
Mark Shannon [Fri, 28 Jan 2022 15:20:33 +0000 (15:20 +0000)] 
bpo-46072: Add simple stats for Python calls. (GH-30989)

3 years agobpo-46417: _PyStructSequence_FiniType() updates _Py_RefTotal (GH-30988)
Victor Stinner [Fri, 28 Jan 2022 13:08:32 +0000 (14:08 +0100)] 
bpo-46417: _PyStructSequence_FiniType() updates _Py_RefTotal (GH-30988)

3 years agobpo-46329: Split calls into precall and call instructions. (GH-30855)
Mark Shannon [Fri, 28 Jan 2022 12:42:30 +0000 (12:42 +0000)] 
bpo-46329: Split calls into precall and call instructions. (GH-30855)

* Add PRECALL_FUNCTION opcode.

* Move 'call shape' varaibles into struct.

* Replace CALL_NO_KW and CALL_KW with KW_NAMES and CALL instructions.

* Specialize for builtin methods taking using the METH_FASTCALL | METH_KEYWORDS protocol.

* Allow kwnames for specialized calls to builtin types.

* Specialize calls to tuple(arg) and str(arg).

3 years agobpo-46449: deepfreeze get_code() now returns strong ref (GH-30987)
Kumar Aditya [Fri, 28 Jan 2022 12:41:13 +0000 (18:11 +0530)] 
bpo-46449: deepfreeze get_code() now returns strong ref  (GH-30987)

3 years agobpo-42238: [doc] Avoid hardcoding fast-moving lines in susp-ignored.csv. (GH-30981)
Julien Palard [Fri, 28 Jan 2022 09:50:58 +0000 (10:50 +0100)] 
bpo-42238: [doc] Avoid hardcoding fast-moving lines in susp-ignored.csv. (GH-30981)

3 years agobpo-46530: add `"thread_time"` to `test_time.test_get_clock_info` (#30913)
Nikita Sobolev [Fri, 28 Jan 2022 05:43:00 +0000 (08:43 +0300)] 
bpo-46530: add `"thread_time"` to `test_time.test_get_clock_info` (#30913)

3 years agobpo-46407: Optimizing some modulo operations (GH-30653)
Crowthebird [Fri, 28 Jan 2022 00:46:45 +0000 (08:46 +0800)] 
bpo-46407: Optimizing some modulo operations (GH-30653)

Added new internal functions to compute mod without also computing the quotient.

The loops can be leaner then, which leads to modestly but reliably faster execution in contexts that know they don't need the quotient.

Code by Jeremiah Vivian (Pascual).

3 years agobpo-46542: test_json uses support.infinite_recursion() (GH-30972)
Victor Stinner [Fri, 28 Jan 2022 00:35:13 +0000 (01:35 +0100)] 
bpo-46542: test_json uses support.infinite_recursion() (GH-30972)

Fix test_json tests checking for RecursionError: modify these tests
to use support.infinite_recursion().

3 years agobpo-40170: Remove PyHeapType_GET_MEMBERS() macro (GH-30942)
Victor Stinner [Thu, 27 Jan 2022 23:39:52 +0000 (00:39 +0100)] 
bpo-40170: Remove PyHeapType_GET_MEMBERS() macro (GH-30942)

Remove the PyHeapType_GET_MEMBERS() macro. It was exposed in the
public C API by mistake, it must only be used by Python internally.
Use the PyTypeObject.tp_members member instead.

Rename PyHeapType_GET_MEMBERS() to _PyHeapType_GET_MEMBERS() and move
it to the internal C API.

3 years agobpo-40170: Move _Py_GetAllocatedBlocks() to pycore_pymem.h (GH-30943)
Victor Stinner [Thu, 27 Jan 2022 20:23:22 +0000 (21:23 +0100)] 
bpo-40170: Move _Py_GetAllocatedBlocks() to pycore_pymem.h (GH-30943)

Move _Py_GetAllocatedBlocks() and _PyObject_DebugMallocStats()
declarations to pycore_pymem.h. These functions are related to memory
allocators, not to the PyObject structure.

3 years agobpo-46417: signal: move siginfo_type to the module state (GH-30964)
Victor Stinner [Thu, 27 Jan 2022 20:21:50 +0000 (21:21 +0100)] 
bpo-46417: signal: move siginfo_type to the module state (GH-30964)

3 years agobpo-42982: update pbkdf2 example & add another link (GH-30966)
Gregory P. Smith [Thu, 27 Jan 2022 20:18:28 +0000 (12:18 -0800)] 
bpo-42982: update pbkdf2 example & add another link (GH-30966)

Automerge-Triggered-By: GH:gpshead
3 years agobpo-46476: Simplify and fix _PyStaticCode_Dealloc (GH-30965)
Christian Heimes [Thu, 27 Jan 2022 19:32:12 +0000 (21:32 +0200)] 
bpo-46476: Simplify and fix _PyStaticCode_Dealloc (GH-30965)

3 years agobpo-46541: Generate the global objects initializer. (gh-30941)
Eric Snow [Thu, 27 Jan 2022 18:06:09 +0000 (11:06 -0700)] 
bpo-46541: Generate the global objects initializer. (gh-30941)

This change is a prerequisite for generating code for other global objects (like strings in gh-30928).

(We borrowed some code from Tools/scripts/deepfreeze.py.)

https://bugs.python.org/issue46541

3 years agobpo-46098: Add test for multiline syntax error traceback (GH-30695)
Russel Webber [Thu, 27 Jan 2022 14:13:12 +0000 (14:13 +0000)] 
bpo-46098: Add test for multiline syntax error traceback (GH-30695)

3 years agobpo-44734: Fix floating point precision in test_turtle (GH-30910)
Karolina Surma [Thu, 27 Jan 2022 13:57:55 +0000 (14:57 +0100)] 
bpo-44734: Fix floating point precision in test_turtle (GH-30910)

3 years agobpo-46458: emit code for else of a try block immediately after the try body (GH-30751)
Irit Katriel [Thu, 27 Jan 2022 13:40:44 +0000 (13:40 +0000)] 
bpo-46458: emit code for else of a try block immediately after the try body (GH-30751)

3 years agobpo-46476: Fix memory leak in code objects generated by deepfreeze (GH-30853)
Kumar Aditya [Thu, 27 Jan 2022 13:03:47 +0000 (18:33 +0530)] 
bpo-46476: Fix memory leak in code objects generated by deepfreeze (GH-30853)

Add _Py_Deepfreeze_Fini() and _PyStaticCode_Dealloc() functions.

3 years agobpo-44791: Fix substitution of ParamSpec in Concatenate with different parameter...
Serhiy Storchaka [Thu, 27 Jan 2022 12:34:55 +0000 (14:34 +0200)] 
bpo-44791: Fix substitution of ParamSpec in Concatenate with different parameter expressions (GH-27518)

* Substitution with a list of types returns now a tuple of types.
* Substitution with Concatenate returns now a Concatenate with
  concatenated lists of arguments.
* Substitution with Ellipsis is not supported.

3 years agobpo-46544: Do not leak `x` and `uspace` in textwrap.TextWrapper (GH-30955)
Nikita Sobolev [Thu, 27 Jan 2022 11:55:58 +0000 (14:55 +0300)] 
bpo-46544: Do not leak `x` and `uspace` in textwrap.TextWrapper (GH-30955)

3 years agobpo-23556: [doc] Fix inaccuracy in documentation for raise without args. Improve...
Kinshuk Dua [Thu, 27 Jan 2022 10:24:48 +0000 (15:54 +0530)] 
bpo-23556: [doc] Fix inaccuracy in documentation for raise without args. Improve tests for context in nested except handlers.  (GH-29236)

3 years agobpo-40280: Use presence of msvcrt module to detect Windows (GH-30930)
Christian Heimes [Thu, 27 Jan 2022 09:57:43 +0000 (11:57 +0200)] 
bpo-40280: Use presence of msvcrt module to detect Windows (GH-30930)

3 years agobpo-42982: Improve the text on suggested number of iterations of PBKDF2 (GH-24276)
Illia Volochii [Thu, 27 Jan 2022 08:39:09 +0000 (10:39 +0200)] 
bpo-42982: Improve the text on suggested number of iterations of PBKDF2 (GH-24276)

Less specific number wording (as there is no one right number - the old 100k is too big for some applications and woefully small for others). We now link to NIST SP 800-132 to tell people what to read in there on how to decide for their application.

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
3 years ago[doc]: Spotted errors while working on rstlint. (GH-30879)
Julien Palard [Thu, 27 Jan 2022 07:57:43 +0000 (08:57 +0100)] 
[doc]: Spotted errors while working on rstlint. (GH-30879)

Also ignored some `make suspicious` false positives while assuring
true positives were properly seen by rstlint.

3 years agobpo-45162: Revert "Remove many old deprecated unittest features" (GH-30935)
Gregory P. Smith [Thu, 27 Jan 2022 04:39:15 +0000 (20:39 -0800)] 
bpo-45162: Revert "Remove many old deprecated unittest features" (GH-30935)

Revert "bpo-45162: Remove many old deprecated unittest features (GH-28268)"

This reverts commit b0a6ede3d0bd6fa4ffe413ab4dfc1059201df25b.

We're deferring this change until 3.12 while upstream projects that use
the legacy assertion method names are fixed.  See the issue for links
to the discussion. Many upstream projects now have issues and PRs
filed.

3 years agobpo-46496: news11-10 for bpo45296 (GH-30937)
Terry Jan Reedy [Thu, 27 Jan 2022 03:19:32 +0000 (22:19 -0500)] 
bpo-46496: news11-10 for bpo45296 (GH-30937)

3 years agobpo-45296: Clarify close, quit, and exit in IDLE (GH-30936)
Terry Jan Reedy [Thu, 27 Jan 2022 03:16:31 +0000 (22:16 -0500)] 
bpo-45296: Clarify close, quit, and exit in IDLE (GH-30936)

In the File menu, 'Close' and 'Exit' are now 'Close Window' (the current
one) and 'Exit' is now 'Exit IDLE' (by closing all windows).
In Shell, 'quit()' and 'exit()' mean 'close Shell'.
If there are no other windows, this also exits IDLE.

3 years agobpo-46539: Pass status of special typeforms to forward references (GH-30926)
Gregory Beauregard [Thu, 27 Jan 2022 03:11:51 +0000 (19:11 -0800)] 
bpo-46539: Pass status of special typeforms to forward references (GH-30926)

Previously this didn't matter because there weren't any valid code paths
that could trigger a type check with a special form, but after the bug
fix for `Annotated` wrapping special forms it's now possible to annotate
something like `Annotated['ClassVar[int]', (3, 4)]`. This change would
also be needed for proposed future changes, such as allowing `ClassVar`
and `Final` to nest each other in dataclasses.

3 years agobpo-40170: Remove _Py_GetAllocatedBlocks() function (GH-30940)
Victor Stinner [Thu, 27 Jan 2022 02:35:51 +0000 (03:35 +0100)] 
bpo-40170: Remove _Py_GetAllocatedBlocks() function (GH-30940)

Move _Py_GetAllocatedBlocks() and _PyObject_DebugMallocStats()
private functions to the internal C API.

3 years agobpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function (GH-30938)
Victor Stinner [Thu, 27 Jan 2022 02:00:55 +0000 (03:00 +0100)] 
bpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function (GH-30938)

Convert the PyType_SUPPORTS_WEAKREFS() macro to a regular function.
It no longer access the PyTypeObject.tp_weaklistoffset member
directly.

Add _PyType_SUPPORTS_WEAKREFS() static inline functions, used
internally by Python for best performance.

3 years agobpo-46502: Remove "How do I tell incomplete input" from FAQ (GH-30925)
Mateusz Łoskot [Wed, 26 Jan 2022 23:49:06 +0000 (00:49 +0100)] 
bpo-46502: Remove "How do I tell incomplete input" from FAQ (GH-30925)

Since,

- Py_CompileString no longer allows to distinguish "incomplete input"
  from "invalid input"
- there is no alternative solution available from the Python C API
  due to how the new parser works (rewritten in 3.9)
- the only supported way is to manually import the codeop module from C
  and use its API as IDLE does, and accept its own complications

it is desirable to remove this Q&A from the official FAQ.

3 years agomake regen-all now suggests running: make autoconf (GH-30893)
Victor Stinner [Wed, 26 Jan 2022 23:35:40 +0000 (00:35 +0100)] 
make regen-all now suggests running: make autoconf (GH-30893)

"make autoconf" also runs autoheader, whereas "autoconf" does not.

3 years agobpo-38472: setup.py uses LC_ALL=C to check the C compiler (GH-30929)
Victor Stinner [Wed, 26 Jan 2022 23:22:04 +0000 (00:22 +0100)] 
bpo-38472: setup.py uses LC_ALL=C to check the C compiler (GH-30929)

Fix GCC detection in setup.py when cross-compiling. The C compiler is
now run with LC_ALL=C. Previously, the detection failed with a German
locale.

3 years agobpo-46528: Simplify the VM's stack manipulations (GH-30902)
Brandt Bucher [Wed, 26 Jan 2022 20:47:45 +0000 (12:47 -0800)] 
bpo-46528: Simplify the VM's stack manipulations (GH-30902)

3 years agobpo-35134: Add Include/cpython/descrobject.h (GH-30923)
Victor Stinner [Wed, 26 Jan 2022 16:32:47 +0000 (17:32 +0100)] 
bpo-35134: Add Include/cpython/descrobject.h (GH-30923)

Move Include/descrobject.h non-limited API to a new
Include/cpython/descrobject.h header file.

3 years agobpo-43853: Expand test suite for SQLite UDF's (GH-27642)
Erlend Egeberg Aasland [Wed, 26 Jan 2022 16:26:16 +0000 (17:26 +0100)] 
bpo-43853: Expand test suite for SQLite UDF's (GH-27642)

3 years agobpo-46527: allow calling enumerate(iterable=...) again (GH-30904)
Jelle Zijlstra [Wed, 26 Jan 2022 15:46:48 +0000 (07:46 -0800)] 
bpo-46527: allow calling enumerate(iterable=...) again (GH-30904)

3 years agoUse existing unbound_local_error label in DELETE_FAST opcode (GH-30882)
Kumar Aditya [Wed, 26 Jan 2022 13:58:28 +0000 (19:28 +0530)] 
Use existing unbound_local_error label in DELETE_FAST opcode (GH-30882)

3 years agobpo-46529: increase coverage of `typing.Union.__repr__` method (GH-30911)
Nikita Sobolev [Wed, 26 Jan 2022 10:13:02 +0000 (13:13 +0300)] 
bpo-46529: increase coverage of `typing.Union.__repr__` method (GH-30911)

3 years agobpo-43698: do not use `...` as argument name in docs (GH-30502)
Nikita Sobolev [Wed, 26 Jan 2022 10:06:10 +0000 (13:06 +0300)] 
bpo-43698: do not use `...` as argument name in docs (GH-30502)

3 years agobpo-45578: add a test case for `dis.findlabels` (GH-30058)
Nikita Sobolev [Wed, 26 Jan 2022 10:05:35 +0000 (13:05 +0300)] 
bpo-45578: add a test case for `dis.findlabels` (GH-30058)

3 years agobpo-46513: Remove AC_C_CHAR_UNSIGNED / __CHAR_UNSIGNED__ (GH-30851)
Christian Heimes [Wed, 26 Jan 2022 09:03:49 +0000 (11:03 +0200)] 
bpo-46513: Remove AC_C_CHAR_UNSIGNED / __CHAR_UNSIGNED__ (GH-30851)

3 years agobpo-41844: Update IDLE part of What's New 3.9 to 20228 (GH-30905)
Terry Jan Reedy [Wed, 26 Jan 2022 04:49:54 +0000 (23:49 -0500)] 
bpo-41844: Update IDLE part of What's New 3.9 to 20228 (GH-30905)

3 years agobpo-48146: Update IDLE part of What's New 3.10 to 2022 (GH-30906)
Terry Jan Reedy [Wed, 26 Jan 2022 04:48:53 +0000 (23:48 -0500)] 
bpo-48146: Update IDLE part of What's New 3.10 to 2022 (GH-30906)

3 years agobpo-46431: use raw string for regex in test (GH-30901)
Irit Katriel [Tue, 25 Jan 2022 23:52:43 +0000 (23:52 +0000)] 
bpo-46431: use raw string for regex in test (GH-30901)

3 years agoAdd skips to crashing tests under sanitizers instead of manually skipping them (GH...
Pablo Galindo Salgado [Tue, 25 Jan 2022 23:14:03 +0000 (23:14 +0000)] 
Add skips to crashing tests under sanitizers instead of manually skipping them (GH-30897)