]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agobpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866)
ty [Sun, 27 Mar 2022 20:22:22 +0000 (04:22 +0800)] 
bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866)

Add missing terminated NUL in sockaddr_un's length

- Linux: https://man7.org/linux/man-pages/man7/unix.7.html
- *BSD: SUN_LEN

3 years agobpo-47127: Specialize calls for fastcall c methods with keywords (GH-32125)
Kumar Aditya [Sun, 27 Mar 2022 19:53:25 +0000 (01:23 +0530)] 
bpo-47127: Specialize calls for fastcall c methods with keywords (GH-32125)

* add PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS

3 years agobpo-46429: tweak deepfreeze output (#32107)
Kumar Aditya [Sun, 27 Mar 2022 18:46:22 +0000 (00:16 +0530)] 
bpo-46429: tweak deepfreeze output (#32107)

3 years agobpo-45171: Remove tests of deprecated logger.warn(). (GH-32139)
Jouke Witteveen [Sun, 27 Mar 2022 18:22:05 +0000 (20:22 +0200)] 
bpo-45171: Remove tests of deprecated logger.warn(). (GH-32139)

3 years agobpo-45171: Fix stacklevel handling in logging. (GH-28287)
Jouke Witteveen [Sun, 27 Mar 2022 13:49:28 +0000 (15:49 +0200)] 
bpo-45171: Fix stacklevel handling in logging. (GH-28287)

3 years agobpo-47098: Replace Keccak Code Package with tiny_sha3 (GH-32060)
Christian Heimes [Sat, 26 Mar 2022 20:36:08 +0000 (22:36 +0200)] 
bpo-47098: Replace Keccak Code Package with tiny_sha3 (GH-32060)

3 years agobpo-47095: Use libb2 to provide blake2 implementation (GH-32059)
Christian Heimes [Sat, 26 Mar 2022 19:52:24 +0000 (21:52 +0200)] 
bpo-47095: Use libb2 to provide blake2 implementation (GH-32059)

3 years agobpo-47116: use _PyLong_FromUnsignedChar instead of PyLong_FromLong (GH-32110)
Pieter Eendebak [Sat, 26 Mar 2022 19:47:38 +0000 (20:47 +0100)] 
bpo-47116: use _PyLong_FromUnsignedChar instead of PyLong_FromLong (GH-32110)

3 years agobpo-43224: Implement PEP 646 grammar changes (GH-31018)
Matthew Rahtz [Sat, 26 Mar 2022 16:55:35 +0000 (16:55 +0000)] 
bpo-43224: Implement PEP 646 grammar changes (GH-31018)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agobpo-47117: Don't crash if we fail to decode characters when the tokenizer buffers...
Pablo Galindo Salgado [Sat, 26 Mar 2022 16:29:02 +0000 (16:29 +0000)] 
bpo-47117: Don't crash if we fail to decode characters when the tokenizer buffers are uninitialized (GH-32129)

Automerge-Triggered-By: GH:pablogsal
3 years agobpo-47105: Cite grp.h instead of pwd.h in grp docs (GH-32091)
Alex Hedges [Sat, 26 Mar 2022 00:09:40 +0000 (20:09 -0400)] 
bpo-47105: Cite grp.h instead of pwd.h in grp docs (GH-32091)

3 years agobpo-47062: Rename factory argument to loop_factory (GH-32113)
Andrew Svetlov [Fri, 25 Mar 2022 22:26:23 +0000 (00:26 +0200)] 
bpo-47062: Rename factory argument to loop_factory (GH-32113)

3 years agobpo-43352: Add a Barrier object in asyncio lib (GH-24903)
Duprat [Fri, 25 Mar 2022 22:01:21 +0000 (23:01 +0100)] 
bpo-43352: Add a Barrier object in asyncio lib (GH-24903)

Co-authored-by: Yury Selivanov <yury@edgedb.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agobpo-47118: Fix asyncio.Runner tests error (32117)
Andrew Svetlov [Fri, 25 Mar 2022 17:59:29 +0000 (19:59 +0200)] 
bpo-47118: Fix asyncio.Runner tests error (32117)

3 years agoFix some typos in whatsnew (GH-32098)
Kurt McKee [Fri, 25 Mar 2022 17:32:05 +0000 (10:32 -0700)] 
Fix some typos in whatsnew (GH-32098)

* Fix some typos and phrasing

* Convert the `hash()` text to a link

* Remove definite article

3 years agobpo-47053: Reduce deoptimization in BINARY_OP_INPLACE_ADD_UNICODE (GH-31318)
Dennis Sweeney [Fri, 25 Mar 2022 16:13:19 +0000 (12:13 -0400)] 
bpo-47053: Reduce deoptimization in BINARY_OP_INPLACE_ADD_UNICODE (GH-31318)

* Don't deopt if refcounts are too big

* Detect more at specialization time

3 years agobpo-42197: Don't create `f_locals` dictionary unless we actually need it. (GH-32055)
Mark Shannon [Fri, 25 Mar 2022 12:57:50 +0000 (12:57 +0000)] 
bpo-42197: Don't create `f_locals` dictionary unless we actually need it. (GH-32055)

* `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer called during profile and tracing.
 (Contributed by Fabio Zadrozny)

* Make accesses to a frame's `f_locals` safe from C code, not relying on calls to `PyFrame_FastToLocals` or `PyFrame_LocalsToFast`.

* Document new `PyFrame_GetLocals` C-API function.

3 years agoAdd an issue template config for the migration (GH-32101)
Ezio Melotti [Thu, 24 Mar 2022 23:45:50 +0000 (00:45 +0100)] 
Add an issue template config for the migration (GH-32101)

3 years agobpo-40280: Add wasm32-emscripten and wasm32-wasi SOABI (GH-32095)
Christian Heimes [Thu, 24 Mar 2022 21:09:42 +0000 (23:09 +0200)] 
bpo-40280: Add wasm32-emscripten and wasm32-wasi SOABI (GH-32095)

Shared extension on Emscripten now have suffix
``.cpython-311-wasm32-emscripten.so`` (JS loader) and
``.cpython-311-wasm32-emscripten.wasm`` (WebAssembly code).

3 years agobpo-47062: Implement asyncio.Runner context manager (GH-31799)
Andrew Svetlov [Thu, 24 Mar 2022 19:51:16 +0000 (21:51 +0200)] 
bpo-47062: Implement asyncio.Runner context manager (GH-31799)

Co-authored-by: Zachary Ware <zach@python.org>
3 years agobpo-46841: remove no-longer-used macro UPDATE_PREV_INSTR_OPARG (GH-32100)
Irit Katriel [Thu, 24 Mar 2022 18:54:35 +0000 (18:54 +0000)] 
bpo-46841: remove no-longer-used macro UPDATE_PREV_INSTR_OPARG (GH-32100)

3 years agobpo-40465: Document random module changes in 3.11 What's new (#31818)
Tomáš Hrnčiar [Thu, 24 Mar 2022 13:22:58 +0000 (14:22 +0100)] 
bpo-40465: Document random module changes in 3.11 What's new (#31818)

3 years agobpo-46480: rephrase typing.assert_type docs (GH-32069)
Shantanu [Thu, 24 Mar 2022 02:15:06 +0000 (19:15 -0700)] 
bpo-46480: rephrase typing.assert_type docs (GH-32069)

The goal here is to reduce potential confusion between
`assert_type(val, type)` and `assert isinstance(val, typ)`.

The former is meant to ask a type checker to confirm a fact, the latter
is meant to tell a type checker a fact. The behaviour of the latter more
closely resembles what I'd expect from the prior phrasing of
"assert [something] to the type checker".

3 years agoFix GPG signing in Windows release build (GH-32089)
Steve Dower [Wed, 23 Mar 2022 23:36:26 +0000 (23:36 +0000)] 
Fix GPG signing in Windows release build (GH-32089)

3 years agobpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase (GH-32086)
Andrew Svetlov [Wed, 23 Mar 2022 21:17:07 +0000 (23:17 +0200)] 
bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase (GH-32086)

3 years agobpo-47101: list only activated algorithms in hashlib.algorithms_available (GH-32076)
Christian Heimes [Wed, 23 Mar 2022 20:30:05 +0000 (22:30 +0200)] 
bpo-47101: list only activated algorithms in hashlib.algorithms_available (GH-32076)

3 years agobpo-31582: Created a new documentation section describing sys.path initialization...
Russel Webber [Wed, 23 Mar 2022 17:29:40 +0000 (17:29 +0000)] 
bpo-31582: Created a new documentation section describing sys.path initialization (GH-31082)

3 years agobpo-47086: Remove dead link to old CHM documentation (GH-32075)
Steve Dower [Wed, 23 Mar 2022 16:13:55 +0000 (16:13 +0000)] 
bpo-47086: Remove dead link to old CHM documentation (GH-32075)

3 years agobpo-46712: Do not Regen Deep-Frozen Modules before Generating Global Objects (gh...
Eric Snow [Wed, 23 Mar 2022 15:55:52 +0000 (09:55 -0600)] 
bpo-46712: Do not Regen Deep-Frozen Modules before Generating Global Objects (gh-32061)

We have to run "make regen-deepfreeze" before running Tools/scripts/generate-global-objects.py; otherwise we will miss any changes to global objects in deep-frozen modules (which aren't committed in the repo).  However, building $(PYTHON_FOR_FREEZE) fails if one of its source files had a global object (e.g. via _Py_ID(...)) added or removed, without generate-global-objects.py running first.  So "make regen-global-objects" would sometimes fail.

We solve this by running generate-global-objects.py before *and* after "make regen-deepfreeze". To speed things up and cut down on noise, we also avoid updating the global objects files if there are no changes to them.

https://bugs.python.org/issue46712

3 years agobpo-46541: Add a Comment About When to Use _Py_DECLARE_STR(). (gh-32063)
Eric Snow [Wed, 23 Mar 2022 15:52:50 +0000 (09:52 -0600)] 
bpo-46541: Add a Comment About When to Use _Py_DECLARE_STR(). (gh-32063)

In a gh-32003 comment, I realized it wasn't very clear how _Py_DECLARE_STR() should be used.  This changes adds a comment to clarify.

https://bugs.python.org/issue46541

3 years agobpo-46829: Deprecate passing a message into Future.cancel() and Task.cancel() (GH...
Andrew Svetlov [Wed, 23 Mar 2022 15:43:05 +0000 (17:43 +0200)] 
bpo-46829: Deprecate passing a message into Future.cancel() and Task.cancel() (GH-31840)

After a long deliberation we ended up feeling that the message argument for Future.cancel(), added in 3.9, was a bad idea, so we're deprecating it in 3.11 and plan to remove it in 3.13.

3 years agoCorrectly document class instead of function (GH-32016)
slateny [Wed, 23 Mar 2022 14:39:07 +0000 (07:39 -0700)] 
Correctly document class instead of function (GH-32016)

3 years agobpo-46836: Add Doc/c-api/frame.rst (GH-32051)
Victor Stinner [Wed, 23 Mar 2022 12:19:13 +0000 (13:19 +0100)] 
bpo-46836: Add Doc/c-api/frame.rst (GH-32051)

Reorganize the documentation of the PyFrameObject C API.

3 years ago[doc] configparser: avoid inline comments. (GH-31247)
Julien Palard [Wed, 23 Mar 2022 08:35:33 +0000 (09:35 +0100)] 
[doc] configparser: avoid inline comments. (GH-31247)

People are testing those blocs with the default
inline_comment_prefixes of None, leading to a:

configparser.InterpolationSyntaxError: '$' must be followed by '$' or '{', found: '$ sign ($ is the only character that needs to be escaped)'

3 years agobpo-42238: [doc] Some lines moved in rst, but had hardcoded lineno in susp-ignored...
Julien Palard [Wed, 23 Mar 2022 08:34:30 +0000 (09:34 +0100)] 
bpo-42238: [doc] Some lines moved in rst, but had hardcoded lineno in susp-ignored.csv. (GH-32070)

3 years agobpo-47012: speed up iteration of bytes and bytearray (GH-31867)
Kumar Aditya [Wed, 23 Mar 2022 08:30:05 +0000 (14:00 +0530)] 
bpo-47012: speed up iteration of bytes and bytearray (GH-31867)

3 years agobpo-46864: Suppress deprecation warnings for ob_shash. (GH-32042)
Inada Naoki [Wed, 23 Mar 2022 08:11:22 +0000 (17:11 +0900)] 
bpo-46864: Suppress deprecation warnings for ob_shash. (GH-32042)

3 years agoFix typo in Path.iterdir docs (GH-31822)
Matt Williams [Wed, 23 Mar 2022 02:51:41 +0000 (02:51 +0000)] 
Fix typo in Path.iterdir docs (GH-31822)

3 years agobpo-43166: Disable ceval.c optimizations for Windows debug builds (GH-32023)
neonene [Wed, 23 Mar 2022 00:35:25 +0000 (09:35 +0900)] 
bpo-43166: Disable ceval.c optimizations for Windows debug builds (GH-32023)

Also increases the stack allocation when run with `python_d.exe` to account for the extra stack checks that are added.

3 years agobpo-2604: Make doctest.DocTestCase reset globs in teardown (GH-31932)
Daniël van Noord [Tue, 22 Mar 2022 21:01:15 +0000 (22:01 +0100)] 
bpo-2604: Make doctest.DocTestCase reset globs in teardown (GH-31932)

Co-authored-by: Piet Delport
Co-authored-by: Hugo Lopes Tavares
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agobpo-32033: Finalize WASI configure options (GH-32053)
Christian Heimes [Tue, 22 Mar 2022 17:42:09 +0000 (19:42 +0200)] 
bpo-32033: Finalize WASI configure options (GH-32053)

3 years agobpo-46315: Use fopencookie() to avoid dup() in _PyTokenizer_FindEncodingFilename...
Christian Heimes [Tue, 22 Mar 2022 16:08:51 +0000 (18:08 +0200)] 
bpo-46315: Use fopencookie() to avoid dup() in _PyTokenizer_FindEncodingFilename (GH-32033)

WASI does not have dup() and Emscripten's emulation is slow.

3 years agobpo-45150: Fix testing under FIPS mode (GH-32046)
Christian Heimes [Tue, 22 Mar 2022 15:40:43 +0000 (17:40 +0200)] 
bpo-45150: Fix testing under FIPS mode (GH-32046)

3 years agobpo-42885: Optimize search for regular expressions starting with "\A" or "^" (GH...
Serhiy Storchaka [Tue, 22 Mar 2022 15:27:55 +0000 (17:27 +0200)] 
bpo-42885: Optimize search for regular expressions starting with "\A" or "^" (GH-32021)

Affected functions are re.search(), re.split(), re.findall(), re.finditer()
and re.sub().

3 years agobpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910)
Andrew Svetlov [Tue, 22 Mar 2022 14:02:51 +0000 (16:02 +0200)] 
bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
3 years agobpo-47076: Make asyncio.Queue stable on slow test boxes (GH-32040)
Andrew Svetlov [Tue, 22 Mar 2022 14:00:23 +0000 (16:00 +0200)] 
bpo-47076: Make asyncio.Queue stable on slow test boxes (GH-32040)

3 years agobpo-47045: Remove `f_state` field (GH-31963)
Mark Shannon [Tue, 22 Mar 2022 12:57:19 +0000 (12:57 +0000)] 
bpo-47045: Remove `f_state` field (GH-31963)

* Remove the f_state field from _PyInterpreterFrame

*  Make ownership of the frame explicit, replacing the is_generator field with an owner field.

3 years agobpo-47084: Clear Unicode cached representations on finalization (GH-32032)
Jeremy Kloth [Tue, 22 Mar 2022 12:53:51 +0000 (06:53 -0600)] 
bpo-47084: Clear Unicode cached representations on finalization (GH-32032)

3 years agobpo-46838: Syntax error improvements for function definitions (GH-31590)
Pablo Galindo Salgado [Tue, 22 Mar 2022 11:38:41 +0000 (11:38 +0000)] 
bpo-46838: Syntax error improvements for function definitions (GH-31590)

3 years agobpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)
Christian Heimes [Tue, 22 Mar 2022 10:04:36 +0000 (12:04 +0200)] 
bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)

- Add requires_fork and requires_subprocess to more tests
- Skip extension import tests if dlopen is not available
- Don't assume that _testcapi is a shared extension
- Skip a lot of socket tests that don't work on Emscripten
- Skip mmap tests, mmap emulation is incomplete
- venv does not work yet
- Cannot get libc from executable

The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).

3 years agobpo-28080: Add support for the fallback encoding in ZIP files (GH-32007)
Serhiy Storchaka [Tue, 22 Mar 2022 09:52:55 +0000 (11:52 +0200)] 
bpo-28080: Add support for the fallback encoding in ZIP files (GH-32007)

* Add the metadata_encoding parameter in the zipfile.ZipFile constructor.
* Add the --metadata-encoding option in the zipfile CLI.

Co-authored-by: Stephen J. Turnbull <stephen@xemacs.org>
3 years agobpo-47081: Replace "qualifiers" with "quantifiers" in the re module documentation...
Serhiy Storchaka [Tue, 22 Mar 2022 09:44:47 +0000 (11:44 +0200)] 
bpo-47081: Replace "qualifiers" with "quantifiers" in the re module documentation (GH-32028)

It is a more commonly used term.

3 years agobpo-45150: Add hashlib.file_digest() for efficient file hashing (GH-31930)
Christian Heimes [Tue, 22 Mar 2022 09:37:00 +0000 (11:37 +0200)] 
bpo-45150: Add hashlib.file_digest() for efficient file hashing (GH-31930)

3 years agobpo-47086: Remove .chm from Windows installer and add HTML docs (GH-32038)
Steve Dower [Tue, 22 Mar 2022 01:08:37 +0000 (01:08 +0000)] 
bpo-47086: Remove .chm from Windows installer and add HTML docs (GH-32038)

3 years agobpo-44336: Prevent tests hanging on child process handles on Windows (GH-26578)
Jeremy Kloth [Tue, 22 Mar 2022 00:06:55 +0000 (18:06 -0600)] 
bpo-44336: Prevent tests hanging on child process handles on Windows (GH-26578)

Replace the child process `typeperf.exe` with a daemon thread that reads the performance counters directly.  This prevents the issues that arise from inherited handles in grandchild processes (see issue37531 for discussion).

We only use the load tracker when running tests in multiprocess mode. This prevents inadvertent interactions with tests expecting a single threaded environment.  Displaying load is really only helpful for buildbots running in multiprocess mode anyway.

3 years agobpo-47061: document module deprecations due to PEP 594 (GH-31984)
Brett Cannon [Mon, 21 Mar 2022 23:16:37 +0000 (16:16 -0700)] 
bpo-47061: document module deprecations due to PEP 594 (GH-31984)

Also removed asynchat, asyncore, and smtpd from their respective toctree entries so they are only  in the superceded subtree.

3 years agoFix typo in pycore_bytesobject.h (GH-31914)
jonasdlindner [Mon, 21 Mar 2022 23:11:50 +0000 (00:11 +0100)] 
Fix typo in pycore_bytesobject.h (GH-31914)

3 years agobpo-12029: [doc] clarify that except does not match virtual subclasses of the specifi...
Irit Katriel [Mon, 21 Mar 2022 20:41:35 +0000 (20:41 +0000)] 
bpo-12029: [doc] clarify that except does not match virtual subclasses of the specified exception type (GH-32027)

3 years agobpo-47067: Optimize calling GenericAlias objects (GH-31996)
penguin_wwy [Mon, 21 Mar 2022 20:33:02 +0000 (04:33 +0800)] 
bpo-47067: Optimize calling GenericAlias objects (GH-31996)

Use vectorcall, and replace `PyObject_SetAttrString` with `PyObject_SetAttr` and a global string.

3 years agobpo-47080: Use atomic groups to simplify fnmatch (GH-32029)
Tim Peters [Mon, 21 Mar 2022 17:49:43 +0000 (12:49 -0500)] 
bpo-47080: Use atomic groups to simplify fnmatch (GH-32029)

Use re's new atomic groups to greatly simplify the construction of worst-case linear-time patterns.

3 years agobpo-433030: Add support of atomic grouping in regular expressions (GH-31982)
Serhiy Storchaka [Mon, 21 Mar 2022 16:28:22 +0000 (18:28 +0200)] 
bpo-433030: Add support of atomic grouping in regular expressions (GH-31982)

* Atomic grouping: (?>...).
* Possessive quantifiers: x++, x*+, x?+, x{m,n}+.
  Equivalent to (?>x+), (?>x*), (?>x?), (?>x{m,n}).

Co-authored-by: Jeffrey C. Jacobs <timehorse@users.sourceforge.net>
3 years agobpo-46841: Quicken code in-place (GH-31888)
Brandt Bucher [Mon, 21 Mar 2022 11:11:17 +0000 (04:11 -0700)] 
bpo-46841: Quicken code in-place (GH-31888)

* Moves the bytecode to the end of the corresponding PyCodeObject, and quickens it in-place.

* Removes the almost-always-unused co_varnames, co_freevars, and co_cellvars member caches

* _PyOpcode_Deopt is a new mapping from all opcodes to their un-quickened forms.

* _PyOpcode_InlineCacheEntries is renamed to _PyOpcode_Caches

* _Py_IncrementCountAndMaybeQuicken is renamed to _PyCode_Warmup

* _Py_Quicken is renamed to _PyCode_Quicken

* _co_quickened is renamed to _co_code_adaptive (and is now a read-only memoryview).

* Do not emit unused nonzero opargs anymore in the compiler.

3 years agobpo-23691: Protect the re.finditer() iterator from re-entering (GH-32012)
Serhiy Storchaka [Mon, 21 Mar 2022 11:00:43 +0000 (13:00 +0200)] 
bpo-23691: Protect the re.finditer() iterator from re-entering (GH-32012)

3 years agobpo-46850: Remove _PyEval_CallTracing() function (GH-32019)
Victor Stinner [Mon, 21 Mar 2022 02:03:22 +0000 (03:03 +0100)] 
bpo-46850: Remove _PyEval_CallTracing() function (GH-32019)

Remove the private undocumented function _PyEval_CallTracing() from
the C API. Call the public sys.call_tracing() function instead.

3 years agobpo-46850: Remove _PyEval_GetCoroutineOriginTrackingDepth() (GH-32018)
Victor Stinner [Mon, 21 Mar 2022 01:24:00 +0000 (02:24 +0100)] 
bpo-46850: Remove _PyEval_GetCoroutineOriginTrackingDepth() (GH-32018)

Remove the private undocumented function
_PyEval_GetCoroutineOriginTrackingDepth() from the C API. Call the
public sys.get_coroutine_origin_tracking_depth() function instead.

Change the internal function
_PyEval_SetCoroutineOriginTrackingDepth():

* Remove the 'tstate' parameter;
* Add return value and raises an exception if depth is negative;
* No longer export the function: call the public
  sys.set_coroutine_origin_tracking_depth() function instead.

Uniformize also function declarations in pycore_ceval.h.

3 years agobpo-46850: Remove _PyEval_SetAsyncGenFinalizer() (GH-32017)
Victor Stinner [Mon, 21 Mar 2022 00:15:32 +0000 (01:15 +0100)] 
bpo-46850: Remove _PyEval_SetAsyncGenFinalizer() (GH-32017)

Remove the following private undocumented functions from the C API:

* _PyEval_GetAsyncGenFirstiter()
* _PyEval_GetAsyncGenFinalizer()
* _PyEval_SetAsyncGenFirstiter()
* _PyEval_SetAsyncGenFinalizer()

Call the public sys.get_asyncgen_hooks() and sys.set_asyncgen_hooks()
functions instead.

3 years agobpo-38256: Fix binascii.crc32() when inputs are 4+GiB (GH-32000)
Gregory P. Smith [Sun, 20 Mar 2022 19:28:15 +0000 (12:28 -0700)] 
bpo-38256: Fix binascii.crc32() when inputs are 4+GiB (GH-32000)

When compiled with `USE_ZLIB_CRC32` defined (`configure` sets this on POSIX systems), `binascii.crc32(...)` failed to compute the correct value when the input data was >= 4GiB. Because the zlib crc32 API is limited to a 32-bit length.

This lines it up with the `zlib.crc32(...)` implementation that doesn't have that flaw.

**Performance:** This also adopts the same GIL releasing for larger inputs logic that `zlib.crc32` has, and causes the Windows build to always use zlib's crc32 instead of our slow C code as zlib is a required build dependency on Windows.

3 years agobpo-47015: Update test_os from asyncore to asyncio (GH-31876)
Oleg Iarygin [Sun, 20 Mar 2022 14:39:12 +0000 (17:39 +0300)] 
bpo-47015: Update test_os from asyncore to asyncio (GH-31876)

3 years agobpo-42369: Fix thread safety of zipfile._SharedFile.tell (GH-26974)
Kevin Mehall [Sun, 20 Mar 2022 14:26:09 +0000 (08:26 -0600)] 
bpo-42369: Fix thread safety of zipfile._SharedFile.tell (GH-26974)

The `_SharedFile` tracks its own virtual position into the file as
`self._pos` and updates it after reading or seeking. `tell()` should
return this position instead of calling into the underlying file object,
since if multiple `_SharedFile` instances are being used concurrently on
the same file, another one may have moved the real file position.
Additionally, calling into the underlying `tell` may expose thread
safety issues in the underlying file object because it was called
without taking the lock.

3 years agobpo-46013: Fix confusing kerning on period in docs (GH-29989)
jmcb [Sun, 20 Mar 2022 09:58:13 +0000 (09:58 +0000)] 
bpo-46013: Fix confusing kerning on period in docs (GH-29989)

3 years agobpo-47040: improve document of checksum functions (gh-31955)
Ma Lin [Sat, 19 Mar 2022 21:42:04 +0000 (05:42 +0800)] 
bpo-47040: improve document of checksum functions (gh-31955)

Clarifies a versionchanged note on crc32 & adler32 docs that the workaround is only needed for Python 2 and earlier.
Also cleans up an unnecessary intermediate variable in the implementation.

Authored-By: Ma Lin / animalize
Co-authored-by: Gregory P. Smith <greg@krypto.org>
3 years agobpo-46382 dataclass(slots=True) now takes inherited slots into account (GH-31980)
Arie Bovenberg [Sat, 19 Mar 2022 21:01:17 +0000 (22:01 +0100)] 
bpo-46382 dataclass(slots=True) now takes inherited slots into account (GH-31980)

Do not include any members in __slots__ that are already in a base class's __slots__.

3 years agobpo-46996: IDLE: Drop workarounds for old Tk versions (GH-31962)
Serhiy Storchaka [Sat, 19 Mar 2022 15:14:21 +0000 (17:14 +0200)] 
bpo-46996: IDLE: Drop workarounds for old Tk versions (GH-31962)

3 years agobpo-47066: Convert a warning about flags not at the start of the regular expression...
Serhiy Storchaka [Sat, 19 Mar 2022 14:10:44 +0000 (16:10 +0200)] 
bpo-47066: Convert a warning about flags not at the start of the regular expression into error (GH-31994)

3 years agobpo-44544: add textwrap placeholder arg (GH-27671)
andrei kulakov [Sat, 19 Mar 2022 12:27:37 +0000 (08:27 -0400)] 
bpo-44544: add textwrap placeholder arg (GH-27671)

3 years agobpo-39394: Improve warning message in the re module (GH-31988)
Serhiy Storchaka [Sat, 19 Mar 2022 12:13:31 +0000 (14:13 +0200)] 
bpo-39394: Improve warning message in the re module (GH-31988)

A warning about inline flags not at the start of the regular
expression now contains the position of the flag.

3 years agobpo-47057: Use FASTCALL convention for FutureIter.throw() (GH-31973)
Andrew Svetlov [Sat, 19 Mar 2022 12:01:46 +0000 (14:01 +0200)] 
bpo-47057: Use FASTCALL convention for FutureIter.throw() (GH-31973)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
3 years agobpo-47022: Document asynchat, asyncore and smtpd removals in 3.12 (GH-31891)
Hugo van Kemenade [Fri, 18 Mar 2022 19:45:37 +0000 (21:45 +0200)] 
bpo-47022: Document asynchat, asyncore and smtpd removals in 3.12 (GH-31891)

Document the deprecation of asyncore, asynchat, and smtpd with a slated removal in Python 3.12 thanks to PEP 594.

3 years agobpo-43224: Add TypeVarTuple.__name__ (GH-31954)
Jelle Zijlstra [Fri, 18 Mar 2022 17:56:36 +0000 (10:56 -0700)] 
bpo-43224: Add TypeVarTuple.__name__ (GH-31954)

I noticed that TypeVar and ParamSpec put their name in a __name__
attribute, but TypeVarTuple doesn't. Let's be consistent.

3 years agobpo-47037: Test debug builds on Windows in CI so that native assertions are noticed...
Steve Dower [Fri, 18 Mar 2022 17:19:28 +0000 (17:19 +0000)] 
bpo-47037: Test debug builds on Windows in CI so that native assertions are noticed sooner (GH-31965)

3 years ago[doc] Some more make suspicious false positives. (GH-31977)
Julien Palard [Fri, 18 Mar 2022 13:48:58 +0000 (14:48 +0100)] 
[doc] Some more make suspicious false positives. (GH-31977)

3 years agobpo-46968: Check for 'sys/auxv.h' in the configure script (GH-31961)
Pablo Galindo Salgado [Fri, 18 Mar 2022 12:03:22 +0000 (12:03 +0000)] 
bpo-46968: Check for 'sys/auxv.h' in the configure script (GH-31961)

3 years agobpo-47037: Don't test for strftime('%4Y') on Windows (GH-31945)
Christian Heimes [Fri, 18 Mar 2022 11:27:20 +0000 (13:27 +0200)] 
bpo-47037: Don't test for strftime('%4Y') on Windows (GH-31945)

3 years agobpo-45786: Remove _PyFrame_Fini() and _PyFrame_DebugMallocStats() (GH-31874)
Victor Stinner [Fri, 18 Mar 2022 10:16:55 +0000 (11:16 +0100)] 
bpo-45786: Remove _PyFrame_Fini() and _PyFrame_DebugMallocStats() (GH-31874)

Remove private empty _PyFrame_Fini() and _PyFrame_DebugMallocStats()
functions.

3 years agosummarize_stats.py: add pairs by opcode (GH-31957)
Dennis Sweeney [Fri, 18 Mar 2022 10:10:31 +0000 (06:10 -0400)] 
summarize_stats.py: add pairs by opcode (GH-31957)

3 years agobpo-45413: Define "posix_venv", "nt_venv" and "venv" sysconfig installation schemes...
Miro Hrončok [Fri, 18 Mar 2022 09:53:29 +0000 (10:53 +0100)] 
bpo-45413: Define "posix_venv", "nt_venv" and "venv" sysconfig installation schemes (GH-31034)

Define *posix_venv* and *nt_venv* sysconfig installation schemes
to be used for bootstrapping new virtual environments.
Add *venv* sysconfig installation scheme to get the appropriate one of the above.
The schemes are identical to the pre-existing
*posix_prefix* and *nt* install schemes.
The venv module now uses the *venv* scheme to create new virtual environments
instead of hardcoding the paths depending only on the platform. Downstream
Python distributors customizing the *posix_prefix* or *nt* install
scheme in a way that is not compatible with the install scheme used in
virtual environments are encouraged not to customize the *venv* schemes.
When Python itself runs in a virtual environment,
sysconfig.get_default_scheme and
sysconfig.get_preferred_scheme with `key="prefix"` returns
*venv*.

3 years agobpo-40296: Fix supporting generic aliases in pydoc (GH-30253)
Serhiy Storchaka [Fri, 18 Mar 2022 09:05:18 +0000 (11:05 +0200)] 
bpo-40296: Fix supporting generic aliases in pydoc (GH-30253)

3 years agobpo-46421: Fix unittest filename evaluation when called as a module (GH-30654)
Bader Zaidan [Thu, 17 Mar 2022 23:37:52 +0000 (00:37 +0100)] 
bpo-46421: Fix unittest filename evaluation when called as a module (GH-30654)

3 years agobpo-47005: Improve performance of bytearray_repeat and bytearray_irepeat (GH-31856)
Pieter Eendebak [Thu, 17 Mar 2022 23:10:36 +0000 (00:10 +0100)] 
bpo-47005: Improve performance of bytearray_repeat and bytearray_irepeat (GH-31856)

3 years agobpo-34790: Remove passing coroutine objects to asyncio.wait() (GH-31964)
Andrew Svetlov [Thu, 17 Mar 2022 20:51:40 +0000 (22:51 +0200)] 
bpo-34790: Remove passing coroutine objects to asyncio.wait() (GH-31964)

Co-authored-by: Yury Selivanov <yury@edgedb.com>
3 years agobpo-46030: socket module add couple of FreeBSD constants. (GH-30018)
David CARLIER [Thu, 17 Mar 2022 20:40:00 +0000 (20:40 +0000)] 
bpo-46030: socket module add couple of FreeBSD constants. (GH-30018)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agoFix whitespace error in setup.py (GH-31960)
Erlend Egeberg Aasland [Thu, 17 Mar 2022 16:53:29 +0000 (17:53 +0100)] 
Fix whitespace error in setup.py (GH-31960)

3 years agobpo-47042: Fix testing the HTML output in test_pydoc (GH-31959)
Serhiy Storchaka [Thu, 17 Mar 2022 16:32:53 +0000 (18:32 +0200)] 
bpo-47042: Fix testing the HTML output in test_pydoc (GH-31959)

Previously it tested that that the actual output contains every non-whitespace
character from the expected output (ignoring order and repetitions).

Now it will test that the actual output contains the same lines as the expected
output, in the same order, ignoring indentation and empty lines.

3 years agoUse low bit of LOAD_GLOBAL's oparg to indicate whether it should push an additional...
Mark Shannon [Thu, 17 Mar 2022 16:14:57 +0000 (16:14 +0000)] 
Use low bit of LOAD_GLOBAL's oparg to indicate whether it should push an additional NULL. (GH-31933)

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>