]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agoPrint summary stats for overall success of specialization. (GH-31211)
Mark Shannon [Tue, 8 Feb 2022 11:50:02 +0000 (11:50 +0000)] 
Print summary stats for overall success of specialization. (GH-31211)

3 years agobpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203)
Gregory Beauregard [Tue, 8 Feb 2022 07:46:58 +0000 (23:46 -0800)] 
bpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203)

3 years agobpo-46323 Fix ref leak if ctypes.CFuncPtr raises an error. (GH-31209)
Dong-hee Na [Tue, 8 Feb 2022 05:22:13 +0000 (14:22 +0900)] 
bpo-46323 Fix ref leak if ctypes.CFuncPtr raises an error. (GH-31209)

3 years agobpo-46678: Fix Invalid cross device link in Lib/test/support/import_helper.py (GH...
Jason Wilkes [Tue, 8 Feb 2022 01:09:07 +0000 (17:09 -0800)] 
bpo-46678: Fix Invalid cross device link in Lib/test/support/import_helper.py (GH-31204)

In [Lib/test/support/import_helper.py](https://github.com/python/cpython/blob/master/Lib/test/support/import_helper.py), the function `make_legacy_pyc` makes a call to `os.rename` which can fail when the source and target live on different devices. This happens (for example) when `PYTHONPYCACHEPREFIX` is set to a directory anywhere on disk, while a ramdisk is mounted on `/tmp` (the latter of which is the default on various Linux distros). Replacing `os.rename` with `shutil.move` fixes this.

Automerge-Triggered-By: GH:brettcannon
3 years agobpo-46659: calendar uses locale.getlocale() (GH-31166)
Victor Stinner [Mon, 7 Feb 2022 23:24:09 +0000 (00:24 +0100)] 
bpo-46659: calendar uses locale.getlocale() (GH-31166)

The calendar.LocaleTextCalendar and calendar.LocaleHTMLCalendar
classes module now use locale.getlocale(), instead of using
locale.getdefaultlocale(), if no locale is specified.

3 years agobpo-46534: Implement PEP 673 Self in typing.py (GH-30924)
James Hilton-Balfe [Mon, 7 Feb 2022 20:47:48 +0000 (20:47 +0000)] 
bpo-46534: Implement PEP 673 Self in typing.py (GH-30924)

Co-authored-by: Pradeep Kumar Srinivasan <gohanpra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agoSkip cron workflow for forks (GH-30748)
Hugo van Kemenade [Mon, 7 Feb 2022 19:40:40 +0000 (21:40 +0200)] 
Skip cron workflow for forks (GH-30748)

3 years agobpo-46638: Makes registry virtualisation setting stable when building MSIX packages...
Steve Dower [Mon, 7 Feb 2022 16:59:40 +0000 (16:59 +0000)] 
bpo-46638: Makes registry virtualisation setting stable when building MSIX packages (GH-31130)

3 years agobpo-46072: Merge dxpairs into py_stats. (GH-31197)
Mark Shannon [Mon, 7 Feb 2022 16:51:43 +0000 (16:51 +0000)] 
bpo-46072: Merge dxpairs into py_stats. (GH-31197)

3 years agobpo-46166: Fix compiler warnings in What's New in Python 3.11 (GH-31198)
Victor Stinner [Mon, 7 Feb 2022 16:46:22 +0000 (17:46 +0100)] 
bpo-46166: Fix compiler warnings in What's New in Python 3.11 (GH-31198)

Fix compiler warnings on PyObject_GetAttrString() calls in the What's
New in Python 3.11 doc of PyFrameObject changes.

3 years agobpo-46670: Fix #ifdef in sha3module.c (GH-31180)
Victor Stinner [Mon, 7 Feb 2022 15:22:24 +0000 (16:22 +0100)] 
bpo-46670: Fix #ifdef in sha3module.c (GH-31180)

* Test if HAVE_ALIGNED_REQUIRED is defined, not its value.
* Define explicitly NOT_PYTHON macro to 0.

Fix "gcc -Wundef" warnings.

3 years agobpo-46670: Remove unused macros in the Python directory (GH-31192)
Victor Stinner [Mon, 7 Feb 2022 15:21:52 +0000 (16:21 +0100)] 
bpo-46670: Remove unused macros in the Python directory (GH-31192)

3 years agobpo-46670: Remove unused macros in the Objects directory (GH-31193)
Victor Stinner [Mon, 7 Feb 2022 15:21:41 +0000 (16:21 +0100)] 
bpo-46670: Remove unused macros in the Objects directory (GH-31193)

3 years ago bpo-46670: Remove unused macros in the Modules directory (GH-31194)
Victor Stinner [Mon, 7 Feb 2022 15:21:31 +0000 (16:21 +0100)] 
 bpo-46670: Remove unused macros in the Modules directory (GH-31194)

* bpo-46670: Remove unused macros in the Modules directory

* Add again LINKAT_DIR_FD_CONVERTER: generated by Argument Clinic

3 years agobpo-39277: Fix PY_TIMEOUT_MAX cast in _threadmodule.c (GH-31195)
Victor Stinner [Mon, 7 Feb 2022 15:21:09 +0000 (16:21 +0100)] 
bpo-39277: Fix PY_TIMEOUT_MAX cast in _threadmodule.c (GH-31195)

Cast PY_TIMEOUT_MAX to double, not to _PyTime_t.

Fix the clang warning:

Modules/_threadmodule.c:1648:26: warning: implicit conversion from
'_PyTime_t' (aka 'long') to 'double' changes value from
9223372036854775 to 9223372036854776
[-Wimplicit-const-int-float-conversion]
    double timeout_max = (_PyTime_t)PY_TIMEOUT_MAX * 1e-6;
                         ^~~~~~~~~~~~~~~~~~~~~~~~~ ~

3 years agobpo-46670: Remove unused macros in ceval.c (GH-31196)
Victor Stinner [Mon, 7 Feb 2022 15:06:27 +0000 (16:06 +0100)] 
bpo-46670: Remove unused macros in ceval.c (GH-31196)

Remove CHECKEXC() and EXT_POP() macros.

3 years agobpo-46072: Improve LOAD_METHOD stats (GH-31104)
Mark Shannon [Mon, 7 Feb 2022 14:30:34 +0000 (14:30 +0000)] 
bpo-46072: Improve LOAD_METHOD stats (GH-31104)

3 years agobpo-46323: _ctypes.CFuncPtr fails if _argtypes_ is too long (GH-31188)
Victor Stinner [Mon, 7 Feb 2022 13:53:15 +0000 (14:53 +0100)] 
bpo-46323: _ctypes.CFuncPtr fails if _argtypes_ is too long (GH-31188)

ctypes.CFUNCTYPE() and ctypes.WINFUNCTYPE() now fail to create the
type if its "_argtypes_" member contains too many arguments.
Previously, the error was only raised when calling a function.

Change also how CFUNCTYPE() and WINFUNCTYPE() handle KeyError to
prevent creating a chain of exceptions if ctypes.CFuncPtr raises an
error.

3 years agobpo-46648: Rewrite test_urllib2.test_issue16464() with a local HTTP server (GH-31186)
Nikita Sobolev [Mon, 7 Feb 2022 12:48:43 +0000 (15:48 +0300)] 
bpo-46648: Rewrite test_urllib2.test_issue16464() with a local HTTP server (GH-31186)

Re-enable test_issue16464() of test_urllib2, move it to urllib2_localnet
and use the local HTTP server rather than an external HTTP server.

3 years agobpo-40479: Fix undefined behavior in Modules/_hashopenssl.c (GH-31153)
Zackery Spytz [Mon, 7 Feb 2022 07:40:54 +0000 (23:40 -0800)] 
bpo-40479: Fix undefined behavior in Modules/_hashopenssl.c (GH-31153)

va_end() must be called before returning.

3 years agobpo-46589: Improve documentation for typing._GenericAlias (GH-31026)
Matthew Rahtz [Mon, 7 Feb 2022 01:59:22 +0000 (01:59 +0000)] 
bpo-46589: Improve documentation for typing._GenericAlias (GH-31026)

(These should arguably be docstrings per convention in the rest of the file, but it doesn't really matter.)

3 years agobpo-46611: add coverage to instance and class checks in `typing.py` (GH-31078)
Nikita Sobolev [Mon, 7 Feb 2022 01:35:48 +0000 (04:35 +0300)] 
bpo-46611: add coverage to instance and class checks in `typing.py` (GH-31078)

3 years agobpo-46670: Test if a macro is defined, not its value (GH-31178)
Victor Stinner [Mon, 7 Feb 2022 00:46:51 +0000 (01:46 +0100)] 
bpo-46670: Test if a macro is defined, not its value (GH-31178)

* audioop.c: #ifdef WORDS_BIGENDIAN
* ctypes.h: #ifdef USING_MALLOC_CLOSURE_DOT_C
* _ctypes/malloc_closure.c: #ifdef HAVE_FFI_CLOSURE_ALLOC
  and #ifdef USING_APPLE_OS_LIBFFI
* pytime.c: #ifdef __APPLE__
* unicodeobject.c: #ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION

3 years agobpo-46670: Define all macros for stringlib (GH-31176)
Victor Stinner [Mon, 7 Feb 2022 00:26:58 +0000 (01:26 +0100)] 
bpo-46670: Define all macros for stringlib (GH-31176)

bytesobject.c, bytearrayobject.c and unicodeobject.c now define all
macros used by stringlib, to avoid using undefined macros.
Fix "gcc -Wundef" warnings.

3 years agobpo-46670: Remove unused get_frame_state() function (GH-31177)
Victor Stinner [Mon, 7 Feb 2022 00:25:44 +0000 (01:25 +0100)] 
bpo-46670: Remove unused get_frame_state() function (GH-31177)

The PyFrame_MAXFREELIST macro is no longer defined.

3 years agobpo-46655: allow stringized TypeAlias with get_type_hints (GH-31156)
Gregory Beauregard [Sun, 6 Feb 2022 23:16:22 +0000 (15:16 -0800)] 
bpo-46655: allow stringized TypeAlias with get_type_hints (GH-31156)

3 years agobpo-46659: test.support avoids locale.getdefaultlocale() (GH-31167)
Victor Stinner [Sun, 6 Feb 2022 20:51:56 +0000 (21:51 +0100)] 
bpo-46659: test.support avoids locale.getdefaultlocale() (GH-31167)

skip_if_buggy_ucrt_strfptime() of test.support now uses
locale.getpreferredencoding(False) instead of
locale.getdefaultlocale() to get the Windows code page.

3 years agobpo-46659: Update the test on the mbcs codec alias (GH-31168)
Victor Stinner [Sun, 6 Feb 2022 20:50:09 +0000 (21:50 +0100)] 
bpo-46659: Update the test on the mbcs codec alias (GH-31168)

encodings registers the _alias_mbcs() codec search function before
the search_function() codec search function. Previously, the
_alias_mbcs() was never used.

Fix the test_codecs.test_mbcs_alias() test: use the current ANSI code
page, not a fake ANSI code page number.

Remove the test_site.test_aliasing_mbcs() test: the alias is now
implemented in the encodings module, no longer in the site module.

3 years agoAdd more tests for variable substitution in generics (GH-31170)
Serhiy Storchaka [Sun, 6 Feb 2022 19:52:39 +0000 (21:52 +0200)] 
Add more tests for variable substitution in generics (GH-31170)

3 years agobpo-46648: Skip test_urllib2.test_issue16464() (GH-31161)
Victor Stinner [Sun, 6 Feb 2022 14:08:54 +0000 (15:08 +0100)] 
bpo-46648: Skip test_urllib2.test_issue16464() (GH-31161)

POST requests to http://www.example.com/ fail randomly.

3 years agobpo-23952: Document cgi module's maxlen variable (GH-30338)
Hugo van Kemenade [Sun, 6 Feb 2022 13:59:32 +0000 (15:59 +0200)] 
bpo-23952: Document cgi module's maxlen variable (GH-30338)

3 years ago[doc] Enhance readability by avoiding big blocks for small numbers. (GH-31157)
Julien Palard [Sun, 6 Feb 2022 12:44:04 +0000 (13:44 +0100)] 
[doc] Enhance readability by avoiding big blocks for small numbers. (GH-31157)

Initially reported by Gregory Jacob on the docs@ mailing list:

https://mail.python.org/archives/list/docs@python.org/thread/VPSFGLOZOHSPF7TGPOI65AOH25TCPSVR/

3 years agobpo-46640: Py_NAN now uses the C99 NAN constant (GH-31134)
Victor Stinner [Sun, 6 Feb 2022 12:13:04 +0000 (13:13 +0100)] 
bpo-46640: Py_NAN now uses the C99 NAN constant (GH-31134)

Building Python now requires a C99 <math.h> header file providing a
NAN constant, or the __builtin_nan() built-in function. If a platform
does not support Not-a-Number (NaN), the Py_NO_NAN macro can be
defined in the pyconfig.h file.

3 years agoAllows to specify the port on which serve documentation (GH-31145)
Christophe Nanteuil [Sun, 6 Feb 2022 10:22:06 +0000 (11:22 +0100)] 
Allows to specify the port on which serve documentation (GH-31145)

[user@localhost]$ make serve      # default configuration, no change
python3 ../Tools/scripts/serve.py build/html
Serving build/html on port 8000, control-C to stop
^CShutting down.

[user@localhost]$ make serve SERVE_PORT=8080 # new option
python3 ../Tools/scripts/serve.py build/html 8080
Serving build/html on port 8080, control-C to stop

3 years agobpo-40280: Address more test failures on Emscripten (GH-31050)
Christian Heimes [Sat, 5 Feb 2022 19:52:01 +0000 (21:52 +0200)] 
bpo-40280: Address more test failures on Emscripten (GH-31050)

Co-authored-by: Brett Cannon <brett@python.org>
3 years agobpo-46608: Fix argument parsing in freeze_modules.py (GH-31131)
Kumar Aditya [Sat, 5 Feb 2022 15:59:48 +0000 (21:29 +0530)] 
bpo-46608: Fix argument parsing in freeze_modules.py (GH-31131)

3 years agoFix __init_subclass__ using self instead of class (#31135)
Gregory Beauregard [Sat, 5 Feb 2022 15:50:00 +0000 (07:50 -0800)] 
Fix __init_subclass__ using self instead of class (#31135)

3 years agobpo-31369: include ``RegexFlag`` in ``re.__all__`` (GH-30279)
andrei kulakov [Sat, 5 Feb 2022 03:54:28 +0000 (22:54 -0500)] 
bpo-31369: include ``RegexFlag`` in ``re.__all__`` (GH-30279)

* added RegexFlag to re.__all__; added RegexFlag.NOFLAG

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agobpo-46608: exclude marshalled-frozen data if deep-freezing to save 300 KB space ...
Kumar Aditya [Fri, 4 Feb 2022 17:57:03 +0000 (23:27 +0530)] 
bpo-46608: exclude marshalled-frozen data if deep-freezing to save 300 KB space  (GH-31074)

This reduces the size of the data segment by **300 KB** of the executable because if the modules are deep-frozen then the marshalled frozen data just wastes space. This was inspired by comment by @gvanrossum in https://github.com/python/cpython/pull/29118#issuecomment-958521863. Note: There is a new option `--deepfreeze-only` in `freeze_modules.py` to change this behavior, it is on be default to save disk space.
```console
# du -s ./python before
27892   ./python
# du -s ./python after
27524   ./python
```

Automerge-Triggered-By: GH:ericsnowcurrently
3 years agobpo-46629: Update classicAppCompat.sccd for new signing certificate (GH-31111)
Steve Dower [Fri, 4 Feb 2022 16:11:19 +0000 (16:11 +0000)] 
bpo-46629: Update classicAppCompat.sccd for new signing certificate (GH-31111)

3 years agoAdd miss stats for specialized instructions. (GH-31108)
Mark Shannon [Fri, 4 Feb 2022 09:56:46 +0000 (09:56 +0000)] 
Add miss stats for specialized instructions. (GH-31108)

3 years agoOptimize images by IMGbot (GH-21348)
Manish Kumar ⛄ [Fri, 4 Feb 2022 06:49:43 +0000 (12:19 +0530)] 
Optimize images by IMGbot (GH-21348)

Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com>
3 years agobpo-46588: fix typo in test_calltip.py (GH-31119)
Caio Agiani [Fri, 4 Feb 2022 04:39:59 +0000 (01:39 -0300)] 
bpo-46588: fix typo in test_calltip.py  (GH-31119)

3 years agoMerge remote-tracking branch 'upstream/main'
Pablo Galindo [Thu, 3 Feb 2022 22:56:59 +0000 (22:56 +0000)] 
Merge remote-tracking branch 'upstream/main'

3 years agoPost 3.11.0a5
Pablo Galindo [Thu, 3 Feb 2022 22:56:12 +0000 (22:56 +0000)] 
Post 3.11.0a5

3 years agobpo-46630: Fix initial focus of IDLE query dialogs (GH-31112)
Terry Jan Reedy [Thu, 3 Feb 2022 22:06:17 +0000 (17:06 -0500)] 
bpo-46630: Fix initial focus of IDLE query dialogs (GH-31112)

On Windows, one had to Tab or click on the entry box
to get a cursor and be able to enter anything.

3 years agobpo-45975: IDLE - Remove extraneous parens (GH-31107)
Terry Jan Reedy [Thu, 3 Feb 2022 19:44:35 +0000 (14:44 -0500)] 
bpo-45975: IDLE - Remove extraneous parens (GH-31107)

mistakenly included in 3 files in previous PR
and backported both to 3.10 and 3.9.

3 years agocloses bpo-46626: Expose IP_BIND_ADDRESS_NO_PORT socket option. (GH-31106)
Benjamin Peterson [Thu, 3 Feb 2022 18:46:50 +0000 (10:46 -0800)] 
closes bpo-46626: Expose IP_BIND_ADDRESS_NO_PORT socket option. (GH-31106)

3 years agoCollect stats for UNPACK_SEQUENCE. (GH-31105)
Mark Shannon [Thu, 3 Feb 2022 18:40:56 +0000 (18:40 +0000)] 
Collect stats for UNPACK_SEQUENCE. (GH-31105)

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 agoPass reference to func, as well as args, when pushing frame. (GH-31100)
Mark Shannon [Thu, 3 Feb 2022 18:36:28 +0000 (18:36 +0000)] 
Pass reference to func, as well as args, when pushing frame. (GH-31100)

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)