]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agoRemove repeated 'the' in docs (GH-28852)
180909 [Sun, 10 Oct 2021 14:05:21 +0000 (22:05 +0800)] 
Remove repeated 'the' in docs (GH-28852)

4 years agobpo-29410: Change the default hash algorithm to SipHash13. (GH-28752)
Inada Naoki [Sun, 10 Oct 2021 08:29:46 +0000 (17:29 +0900)] 
bpo-29410: Change the default hash algorithm to SipHash13. (GH-28752)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Christian Heimes <christian@python.org>
4 years agoFix EncodingWarning in test_tools. (GH-28846)
Inada Naoki [Sun, 10 Oct 2021 07:14:40 +0000 (16:14 +0900)] 
Fix EncodingWarning in test_tools. (GH-28846)

4 years agobpo-45353: Remind sys.modules users to copy when iterating. (GH-28842)
Gregory P. Smith [Sat, 9 Oct 2021 19:34:13 +0000 (12:34 -0700)] 
bpo-45353: Remind sys.modules users to copy when iterating. (GH-28842)

This is true of all dictionaries in Python, but this one tends to
catch people off guard as they don't realize when sys.modules might
change out from underneath them as a hidden side effect of their
code.  Copying it first avoids the RuntimeError.  An example when
this happens in single threaded code are codecs being loaded which
are an implicit time of use import that most need not think about.

4 years agoFix dataclassses spelling (GH-28837)
Landon Yarrington [Sat, 9 Oct 2021 19:17:52 +0000 (13:17 -0600)] 
Fix dataclassses spelling (GH-28837)

4 years agoFix the "Finding all Adverbs" example (GH-21420)
Rim Chatti [Sat, 9 Oct 2021 18:46:56 +0000 (20:46 +0200)] 
Fix the "Finding all Adverbs" example (GH-21420)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-45256: Small cleanups for the code that inlines Python-to-Python calls in ceval...
Pablo Galindo Salgado [Sat, 9 Oct 2021 16:52:05 +0000 (17:52 +0100)] 
bpo-45256: Small cleanups for the code that inlines Python-to-Python calls in ceval.c (GH-28836)

4 years agobpo-27580: Add support of null characters in the csv module. (GH-28808)
Serhiy Storchaka [Sat, 9 Oct 2021 16:17:43 +0000 (19:17 +0300)] 
bpo-27580: Add support of null characters in the csv module. (GH-28808)

4 years agobpo-45256: Remove the usage of the C stack in Python to Python calls (GH-28488)
Pablo Galindo Salgado [Sat, 9 Oct 2021 15:51:30 +0000 (16:51 +0100)] 
bpo-45256: Remove the usage of the C stack in Python to Python calls (GH-28488)

Ths commit inlines calls to Python functions in the eval loop and steals all the arguments in the call from the caller for
performance.

4 years agobpo-20028: Keep original exception when PyUnicode_GetLength return -1 (GH-28832)
Dong-hee Na [Sat, 9 Oct 2021 15:16:12 +0000 (00:16 +0900)] 
bpo-20028: Keep original exception when PyUnicode_GetLength return -1 (GH-28832)

4 years agobpo-20028: Improve error message of csv.Dialect when initializing (GH-28705)
Dong-hee Na [Sat, 9 Oct 2021 14:50:12 +0000 (23:50 +0900)] 
bpo-20028: Improve error message of csv.Dialect when initializing (GH-28705)

4 years agoBump MAGIC_NUMBER to reflect change in JUMP_ABSOLUTE semantics. (GH-28829)
Mark Shannon [Sat, 9 Oct 2021 13:17:22 +0000 (14:17 +0100)] 
Bump MAGIC_NUMBER to reflect change in JUMP_ABSOLUTE semantics. (GH-28829)

4 years ago[doc]: update susp-ignored.csv after a98b273c. (GH-28827)
Julien Palard [Sat, 9 Oct 2021 08:25:00 +0000 (10:25 +0200)] 
[doc]: update susp-ignored.csv after a98b273c. (GH-28827)

4 years agobpo-10716: Migrating pydoc to html5. (GH-28651)
Julien Palard [Sat, 9 Oct 2021 07:36:50 +0000 (09:36 +0200)] 
bpo-10716: Migrating pydoc to html5. (GH-28651)

4 years agoReplace usage of List[...] with list[...] in typing docs (GH-28821)
Micael Jarniac [Sat, 9 Oct 2021 03:33:37 +0000 (00:33 -0300)] 
Replace usage of  List[...] with list[...] in typing docs (GH-28821)

The ``List[...]`` form is deprecated since 3.9.

4 years agobpo-45410: libregrtest -jN writes stderr into stdout (GH-28819)
Victor Stinner [Fri, 8 Oct 2021 15:14:37 +0000 (17:14 +0200)] 
bpo-45410: libregrtest -jN writes stderr into stdout (GH-28819)

When libregrtest spawns a worker process, stderr is now written into
stdout to keep messages order. Use a single pipe for stdout and
stderr, rather than two pipes. Previously, messages were out of order
which made analysis of buildbot logs harder

4 years agobpo-45407: Remove outdated XXX comment from Struct___init___impl (GH-28805)
Jeong YunWon [Fri, 8 Oct 2021 06:45:11 +0000 (15:45 +0900)] 
bpo-45407: Remove outdated XXX comment from Struct___init___impl (GH-28805)

4 years ago bpo-45262, asyncio: Fix cache of the running loop holder (GH-28796)
Matthias Reichl [Thu, 7 Oct 2021 22:46:49 +0000 (00:46 +0200)] 
 bpo-45262, asyncio: Fix cache of the running loop holder (GH-28796)

Prevent use-after-free of running loop holder via cache.

4 years agobpo-45408: Don't override previous tokenizer errors in the second parser pass (GH...
Pablo Galindo Salgado [Thu, 7 Oct 2021 21:33:05 +0000 (22:33 +0100)] 
bpo-45408: Don't override previous tokenizer errors in the second parser pass (GH-28812)

4 years agobpo-45337: Use the realpath of the new executable when creating a venv on Windows...
Steve Dower [Thu, 7 Oct 2021 20:26:12 +0000 (21:26 +0100)] 
bpo-45337: Use the realpath of the new executable when creating a venv on Windows (GH-28663)

4 years agobpo-16379: Fix SQLite version checks in test_module_constants() (GH-28809)
Erlend Egeberg Aasland [Thu, 7 Oct 2021 19:48:13 +0000 (21:48 +0200)] 
bpo-16379: Fix SQLite version checks in test_module_constants() (GH-28809)

Automerge-Triggered-By: GH:pablogsal
4 years agobpo-45403: Fix test_sys.test_stdlib_dir() (GH-28785)
Victor Stinner [Thu, 7 Oct 2021 19:22:28 +0000 (21:22 +0200)] 
bpo-45403: Fix test_sys.test_stdlib_dir() (GH-28785)

Fix test_sys.test_stdlib_dir() when Python is built outside the
source tree: compare normalized paths.

4 years agobpo-45402: Fix test_tools.test_sundry() (GH-28786)
Victor Stinner [Thu, 7 Oct 2021 19:19:13 +0000 (21:19 +0200)] 
bpo-45402: Fix test_tools.test_sundry() (GH-28786)

Fix test_tools.test_sundry() when Python is built out of tree: fix
how the freeze_modules.py tool locates the _freeze_module program.

4 years agoRemove draft notice on the 3.10 What's new document (GH-28806)
Pablo Galindo Salgado [Thu, 7 Oct 2021 18:00:29 +0000 (19:00 +0100)] 
Remove draft notice on the 3.10 What's new document (GH-28806)

Automerge-Triggered-By: GH:pablogsal
4 years agobpo-45400: Fix suggestion test of test_exceptions (GH-28783)
Victor Stinner [Thu, 7 Oct 2021 11:47:23 +0000 (13:47 +0200)] 
bpo-45400: Fix suggestion test of test_exceptions (GH-28783)

Fix test_name_error_suggestions_do_not_trigger_for_too_many_locals()
of test_exceptions if a directory name contains "a1" (like
"Python-3.11.0a1"): use a stricter regular expression.

4 years agobpo-45041: Restore `sqlite3` executescript behaviour for `SELECT` queries (GH-28509)
Erlend Egeberg Aasland [Thu, 7 Oct 2021 09:16:45 +0000 (11:16 +0200)] 
bpo-45041: Restore `sqlite3` executescript behaviour for `SELECT` queries (GH-28509)

* bpo-45041: Restore sqlite3 executescript behaviour for select queries

* Add regression test

4 years agoFix typos in the Modules directory (GH-28761)
Christian Clauss [Thu, 7 Oct 2021 08:34:42 +0000 (10:34 +0200)] 
Fix typos in the Modules directory (GH-28761)

4 years agobpo-35970: Add help flag to base64 module (GH-28774)
Ammar Askar [Thu, 7 Oct 2021 01:38:43 +0000 (21:38 -0400)] 
bpo-35970: Add help flag to base64 module (GH-28774)

This continues off rkuska's work from https://github.com/python/cpython/pull/11789 seeing as the patch wasn't updated to add tests.

4 years agobpo-45385: Fix reference leak from descr_check (#28719)
Dong-hee Na [Thu, 7 Oct 2021 00:51:56 +0000 (09:51 +0900)] 
bpo-45385: Fix reference leak from descr_check (#28719)

4 years agoFix typos in the Objects directory (GH-28766)
Christian Clauss [Wed, 6 Oct 2021 23:57:10 +0000 (01:57 +0200)] 
Fix typos in the Objects directory (GH-28766)

4 years agobpo-29505: Add fuzzer for ast.literal_eval (GH-28777)
Ammar Askar [Wed, 6 Oct 2021 23:22:09 +0000 (19:22 -0400)] 
bpo-29505: Add fuzzer for ast.literal_eval (GH-28777)

This supercedes https://github.com/python/cpython/pull/3437 and fuzzes the method we recommend for unsafe inputs, `ast.literal_eval`. This should exercise the tokenizer and parser.

4 years agoFix typos in the Lib directory (GH-28775)
Christian Clauss [Wed, 6 Oct 2021 23:13:48 +0000 (01:13 +0200)] 
Fix typos in the Lib directory (GH-28775)

Fix typos in the Lib directory as identified by codespell.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 years agoFix typos in the Python directory (GH-28767)
Christian Clauss [Wed, 6 Oct 2021 22:55:27 +0000 (00:55 +0200)] 
Fix typos in the Python directory (GH-28767)

4 years agobpo-45375: Fix off by one error in buffer allocation (GH-28764)
Steve Dower [Wed, 6 Oct 2021 19:09:33 +0000 (20:09 +0100)] 
bpo-45375: Fix off by one error in buffer allocation (GH-28764)

4 years agoFix typos in the Include directory (GH-28745)
Christian Clauss [Wed, 6 Oct 2021 18:32:38 +0000 (20:32 +0200)] 
Fix typos in the Include directory (GH-28745)

4 years ago[doc] Mention __slots__ behavior in weakref.rst (GH-21061)
Jakub Stasiak [Wed, 6 Oct 2021 18:23:02 +0000 (20:23 +0200)] 
[doc] Mention __slots__ behavior in weakref.rst (GH-21061)

It took me longer than I expected to figure out why a random class
I dealt with didn't support weak references. I believe this addition
will make the __slots__/weakref interaction more discoverable to people
having troubles with this. (Before this patch __slots__ was not
mentioned in weakref documentation even once).

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agoFix typos in the Tools directory (GH-28769)
Christian Clauss [Wed, 6 Oct 2021 17:55:16 +0000 (19:55 +0200)] 
Fix typos in the Tools directory (GH-28769)

Like #28744 but for the Tools directory.

[skip issue] Opening a related issue is pending python/psf-infra-meta#130

Automerge-Triggered-By: GH:pablogsal
4 years agobpo-45328: Avoid failure in OSs without TCP_NODELAY support (GH-28646)
rtobar [Wed, 6 Oct 2021 17:49:44 +0000 (01:49 +0800)] 
bpo-45328: Avoid failure in OSs without TCP_NODELAY support (GH-28646)

Operating systems without support for TCP_NODELAY will raise an OSError
when trying to set the socket option, but the show can still go on.

4 years ago[Misc] [Mac] Fix typos found using codespell (GH-28756)
Christian Clauss [Wed, 6 Oct 2021 17:40:09 +0000 (19:40 +0200)] 
[Misc] [Mac] Fix typos found using codespell (GH-28756)

4 years agobpo-40321: Add missing test, slightly expand documentation (GH-28760)
Łukasz Langa [Wed, 6 Oct 2021 15:28:16 +0000 (17:28 +0200)] 
bpo-40321: Add missing test, slightly expand documentation (GH-28760)

4 years agoRemove test_nntplib from quicktest (GH-28754)
Inada Naoki [Wed, 6 Oct 2021 15:03:58 +0000 (00:03 +0900)] 
Remove test_nntplib from quicktest (GH-28754)

4 years agobpo-34804: [doc] Rephrase section on side effects in functional.rst for clarity ...
DonnaDia [Wed, 6 Oct 2021 14:51:55 +0000 (17:51 +0300)] 
bpo-34804: [doc] Rephrase section on side effects in functional.rst for clarity (GH-27989)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-40116: Add insertion order bit-vector to dict values to allow dicts to share...
Mark Shannon [Wed, 6 Oct 2021 12:19:53 +0000 (13:19 +0100)] 
bpo-40116: Add insertion order bit-vector to dict values to allow dicts to share keys more freely. (GH-28520)

4 years agoNormalize jumps in compiler. All forward jumps to use JUMP_FORWARD. (GH-28755)
Mark Shannon [Wed, 6 Oct 2021 12:05:45 +0000 (13:05 +0100)] 
Normalize jumps in compiler. All forward jumps to use JUMP_FORWARD. (GH-28755)

4 years agobpo-40321: Support HTTP response status code 308 in urllib.request (#19588)
Jochem Schulenklopper [Wed, 6 Oct 2021 02:02:58 +0000 (04:02 +0200)] 
bpo-40321: Support HTTP response status code 308 in urllib.request (#19588)

* Support HTTP response status code 308 in urllib.

HTTP response status code 308 is defined in https://tools.ietf.org/html/rfc7538 to be the permanent redirect variant of 307 (temporary redirect).

* Update documentation to include http_error_308()

* Add blurb for bpo-40321 fix

Co-authored-by: Roland Crosby <roland@rolandcrosby.com>
4 years ago[doc] Fix typos found using codespell (GH-28744)
Christian Clauss [Tue, 5 Oct 2021 21:48:44 +0000 (23:48 +0200)] 
[doc] Fix typos found using codespell (GH-28744)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-45343: Update bundled pip to 21.2.4 and setuptools to 58.1.0 (GH-28684)
Illia Volochii [Tue, 5 Oct 2021 21:30:38 +0000 (00:30 +0300)] 
bpo-45343: Update bundled pip to 21.2.4 and setuptools to 58.1.0 (GH-28684)

4 years ago[Tools/peg_generator/pegen/parser.py] Fix typo: s/wether/whether/ (GH-28739)
Ikko Ashimine [Tue, 5 Oct 2021 21:06:19 +0000 (06:06 +0900)] 
[Tools/peg_generator/pegen/parser.py] Fix typo: s/wether/whether/ (GH-28739)

4 years agobpo-45020: Identify which frozen modules are actually aliases. (gh-28655)
Eric Snow [Tue, 5 Oct 2021 17:26:37 +0000 (11:26 -0600)] 
bpo-45020: Identify which frozen modules are actually aliases. (gh-28655)

In the list of generated frozen modules at the top of Tools/scripts/freeze_modules.py, you will find that some of the modules have a different name than the module (or .py file) that is actually frozen. Let's call each case an "alias". Aliases do not come into play until we get to the (generated) list of modules in Python/frozen.c. (The tool for freezing modules, Programs/_freeze_module, is only concerned with the source file, not the module it will be used for.)

Knowledge of which frozen modules are aliases (and the identity of the original module) normally isn't important. However, this information is valuable when we go to set __file__ on frozen stdlib modules. This change updates Tools/scripts/freeze_modules.py to map aliases to the original module name (or None if not a stdlib module) in Python/frozen.c. We also add a helper function in Python/import.c to look up a frozen module's alias and add the result of that function to the frozen info returned from find_frozen().

https://bugs.python.org/issue45020

4 years agoPost 3.11.0a1
Pablo Galindo [Tue, 5 Oct 2021 17:08:06 +0000 (18:08 +0100)] 
Post 3.11.0a1

4 years agoMerge tag 'v3.11.0a1'
Pablo Galindo [Tue, 5 Oct 2021 17:07:59 +0000 (18:07 +0100)] 
Merge tag 'v3.11.0a1'

Python 3.11.0a1

4 years ago[doc] Fix gethostbyname_ex description (GH-28700)
Andre Delfino [Tue, 5 Oct 2021 16:53:35 +0000 (13:53 -0300)] 
[doc] Fix gethostbyname_ex description (GH-28700)

It seems part of `gethostbyname_ex` doc was copied from `gethostbyaddr`. The latter has an `ip_address` parameter whereas the former doesn't.

4 years agoRearrage the finder tests. (gh-28740)
Eric Snow [Tue, 5 Oct 2021 16:37:14 +0000 (10:37 -0600)] 
Rearrage the finder tests. (gh-28740)

This makes the tests a bit cleaner and makes adding more tests a little simpler.

https://bugs.python.org/issue45324

4 years agobpo-45324: Capture data in FrozenImporter.find_spec() to use in exec_module(). (gh...
Eric Snow [Tue, 5 Oct 2021 16:01:27 +0000 (10:01 -0600)] 
bpo-45324: Capture data in FrozenImporter.find_spec() to use in exec_module(). (gh-28633)

Before this change we end up duplicating effort and throwing away data in FrozenImporter.find_spec().  Now we do the work once in find_spec() and the only thing we do in FrozenImporter.exec_module() is turn the raw frozen data into a code object and then exec it.

We've added _imp.find_frozen(), add an arg to _imp.get_frozen_object(), and updated FrozenImporter.  We've also moved some code around to reduce duplication, get a little more consistency in outcomes, and be more efficient.

Note that this change is mostly necessary if we want to set __file__ on frozen stdlib modules. (See https://bugs.python.org/issue21736.)

https://bugs.python.org/issue45324

4 years agobpo-44050: Extension modules can share state when they don't support sub-interpreters...
Hai Shi [Tue, 5 Oct 2021 13:19:32 +0000 (21:19 +0800)] 
bpo-44050: Extension modules can share state when they don't support sub-interpreters. (GH-27794)

Automerge-Triggered-By: GH:encukou
4 years agoPython 3.11.0a1 v3.11.0a1
Pablo Galindo [Tue, 5 Oct 2021 12:42:52 +0000 (13:42 +0100)] 
Python 3.11.0a1

4 years agobpo-45375: Fix assertion failure due to searching for stdlib in unnormalised paths...
Steve Dower [Tue, 5 Oct 2021 12:37:43 +0000 (13:37 +0100)] 
bpo-45375: Fix assertion failure due to searching for stdlib in unnormalised paths (GH-28735)

4 years agobpo-45354: Skip obsolete device name tests on Windows 11 (GH-28712)
Jeremy Kloth [Tue, 5 Oct 2021 12:17:13 +0000 (06:17 -0600)] 
bpo-45354: Skip obsolete device name tests on Windows 11 (GH-28712)

4 years agobpo-45163: Restrict added libnetwork check to builds on Haiku. (GH-28729)
Ned Deily [Tue, 5 Oct 2021 10:02:57 +0000 (06:02 -0400)] 
bpo-45163: Restrict added libnetwork check to builds on Haiku. (GH-28729)

For example, without the guard the check could cause macOS
installer builds to fail to install on older supported macOS
releases where libnetwork is not available and is not needed
on any release.

4 years agobpo-43760: Check for tracing using 'bitwise or' instead of branch in dispatch. (GH...
Mark Shannon [Tue, 5 Oct 2021 10:01:11 +0000 (11:01 +0100)] 
bpo-43760: Check for tracing using 'bitwise or' instead of branch in dispatch. (GH-28723)

4 years agobpo-45371: Fix distutils' rpath support for clang (GH-28732)
Christian Heimes [Tue, 5 Oct 2021 09:43:46 +0000 (12:43 +0300)] 
bpo-45371: Fix distutils' rpath support for clang (GH-28732)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agoFix compiler warning in ceval.c regarding signed comparison (GH-28716)
Pablo Galindo Salgado [Mon, 4 Oct 2021 11:13:46 +0000 (12:13 +0100)] 
Fix compiler warning in ceval.c regarding signed comparison (GH-28716)

4 years agobpo-45355: More use of sizeof(_Py_CODEUNIT) (GH-28720)
Serhiy Storchaka [Mon, 4 Oct 2021 11:11:26 +0000 (14:11 +0300)] 
bpo-45355: More use of sizeof(_Py_CODEUNIT) (GH-28720)

4 years agobpo-28206: Document signals Handlers, Sigmasks and Signals enums (GH-28628)
Bibo-Joshi [Mon, 4 Oct 2021 11:09:40 +0000 (13:09 +0200)] 
bpo-28206: Document signals Handlers, Sigmasks and Signals enums (GH-28628)

Co-authored-by: desbma <desbma@users.noreply.github.com>
4 years agobpo-44594: fix (Async)ExitStack handling of __context__ (gh-27089)
John Belmonte [Mon, 4 Oct 2021 06:49:55 +0000 (15:49 +0900)] 
bpo-44594: fix (Async)ExitStack handling of __context__ (gh-27089)

* bpo-44594: fix (Async)ExitStack handling of __context__

Make enter_context(foo()) / enter_async_context(foo()) equivalent to
`[async] with foo()` regarding __context__ when an exception is raised.

Previously exceptions would be caught and re-raised with the wrong
context when explicitly overriding __context__ with None.

4 years agobpo-45350: Rerun autoreconf with the pkg-config macros (GH-28708)
Pablo Galindo Salgado [Sun, 3 Oct 2021 23:46:52 +0000 (00:46 +0100)] 
bpo-45350: Rerun autoreconf with the pkg-config macros (GH-28708)

4 years agobpo-45355: Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the code...
Serhiy Storchaka [Sun, 3 Oct 2021 18:22:42 +0000 (21:22 +0300)] 
bpo-45355: Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the code unit (GH-28711)

4 years agoRemove news entry without bpo issue number. (GH-28703)
Julien Palard [Sun, 3 Oct 2021 14:21:31 +0000 (16:21 +0200)] 
Remove news entry without bpo issue number. (GH-28703)

I'm just removing an erroneous NEWS entry I previously merged.

Automerge-Triggered-By: GH:JulienPalard
4 years agoRemove trailing spaces. (GH-28706)
Serhiy Storchaka [Sun, 3 Oct 2021 13:58:14 +0000 (16:58 +0300)] 
Remove trailing spaces. (GH-28706)

4 years agoFix spelling error in comment (GH-28696)
Raymond Hettinger [Sat, 2 Oct 2021 18:52:05 +0000 (13:52 -0500)] 
Fix spelling error in comment (GH-28696)

4 years agobpo-45346: Keep docs consistent regarding true and false values (GH-28697)
Raymond Hettinger [Sat, 2 Oct 2021 18:48:08 +0000 (13:48 -0500)] 
bpo-45346: Keep docs consistent regarding true and false values (GH-28697)

4 years agobpo-45329: Fix freed memory access in pyexpat.c (GH-28649)
TAGAMI Yukihiro [Sat, 2 Oct 2021 09:57:13 +0000 (18:57 +0900)] 
bpo-45329: Fix freed memory access in pyexpat.c (GH-28649)

4 years agoMakefile: Fix missing slashes (GH-28659)
native-api [Sat, 2 Oct 2021 09:38:59 +0000 (12:38 +0300)] 
Makefile: Fix missing slashes (GH-28659)

4 years agobpo-45341: Replace 'Packaging' with 'Package' in "Python P... Index" (#28687)
Terry Jan Reedy [Sat, 2 Oct 2021 06:04:55 +0000 (02:04 -0400)] 
bpo-45341: Replace 'Packaging' with 'Package' in "Python P... Index" (#28687)

pypi.org "  The Python Package Index (PyPI) ...

4 years agobpo-44687: Ensure BufferedReader objects with unread buffers can peek even when the...
AngstyDuck [Fri, 1 Oct 2021 20:11:08 +0000 (04:11 +0800)] 
bpo-44687: Ensure BufferedReader objects with unread buffers can peek even when the underlying file is closed (GH-28457)

4 years agoFix a couple of compiler warnings. (GH-28677)
Mark Shannon [Fri, 1 Oct 2021 14:44:19 +0000 (15:44 +0100)] 
Fix a couple of compiler warnings. (GH-28677)

4 years agobpo-45332: Fix broken Decimal test and benchmark (GH-28680)
Dong-hee Na [Fri, 1 Oct 2021 13:49:46 +0000 (13:49 +0000)] 
bpo-45332: Fix broken Decimal test and benchmark (GH-28680)

4 years agohashlib: Fix old message about unicode objects. (GH-28653)
Julien Palard [Fri, 1 Oct 2021 12:38:49 +0000 (14:38 +0200)] 
hashlib: Fix old message about unicode objects. (GH-28653)

4 years agosqlite3: Modernize documentation around unicode and bytes. (GH-28652)
Julien Palard [Fri, 1 Oct 2021 12:37:56 +0000 (14:37 +0200)] 
sqlite3: Modernize documentation around unicode and bytes. (GH-28652)

4 years agobpo-41710: Add private _PyDeadline_Get() function (GH-28674)
Victor Stinner [Fri, 1 Oct 2021 11:29:25 +0000 (13:29 +0200)] 
bpo-41710: Add private _PyDeadline_Get() function (GH-28674)

Add a private C API for deadlines: add _PyDeadline_Init() and
_PyDeadline_Get() functions.

* Add _PyTime_Add() and _PyTime_Mul() functions which compute t1+t2
  and t1*t2 and clamp the result on overflow.
* _PyTime_MulDiv() now uses _PyTime_Add() and _PyTime_Mul().

4 years agobpo-41710: gc_collect_main() uses _PyTime_GetPerfCounter() (GH-28676)
Victor Stinner [Fri, 1 Oct 2021 11:29:00 +0000 (13:29 +0200)] 
bpo-41710: gc_collect_main() uses _PyTime_GetPerfCounter() (GH-28676)

If the DEBUG_STATS debug flag is set, gc_collect_main() now uses
_PyTime_GetPerfCounter() instead of _PyTime_GetMonotonicClock() to
measure the elapsed time.

On Windows, _PyTime_GetMonotonicClock() only has a resolution of 15.6
ms, whereas _PyTime_GetPerfCounter() is closer to a resolution of 100
ns.

4 years agobpo-41710: Fix PY_TIMEOUT_MAX on Windows (GH-28673)
Victor Stinner [Fri, 1 Oct 2021 11:03:03 +0000 (13:03 +0200)] 
bpo-41710: Fix PY_TIMEOUT_MAX on Windows (GH-28673)

WaitForSingleObject() accepts timeout in milliseconds in the range
[0; 0xFFFFFFFE] (DWORD type). INFINITE value (0xFFFFFFFF) means no
timeout. 0xFFFFFFFE milliseconds is around 49.7 days.

PY_TIMEOUT_MAX is (0xFFFFFFFE * 1000) milliseconds on Windows, around
49.7 days.

Partially revert commit 37b8294d6295ca12553fd7c98778be71d24f4b24.

4 years agobpo-45125: Improves pickling docs and tests for `shared_memory` (GH-28294)
Nikita Sobolev [Fri, 1 Oct 2021 10:45:59 +0000 (13:45 +0300)] 
bpo-45125: Improves pickling docs and tests for `shared_memory` (GH-28294)

4 years agoRevert "Revert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650...
Serhiy Storchaka [Fri, 1 Oct 2021 07:57:58 +0000 (10:57 +0300)] 
Revert "Revert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650)" (GH-28667)

This reverts commit b07fddd527efe67174ce6b0fdbe8dac390b16e4e.

4 years agobpo-45310: Fix parrallel shared memory tests (GH-28661)
Serhiy Storchaka [Fri, 1 Oct 2021 07:56:32 +0000 (10:56 +0300)] 
bpo-45310: Fix parrallel shared memory tests (GH-28661)

Add a PID to names of POSIX shared memory objects to allow
running multiprocessing tests (test_multiprocessing_fork,
test_multiprocessing_spawn, etc) in parallel.

4 years agobpo-41710: PyThread_acquire_lock_timed() uses sem_clockwait() (GH-28662)
Victor Stinner [Fri, 1 Oct 2021 07:55:28 +0000 (09:55 +0200)] 
bpo-41710: PyThread_acquire_lock_timed() uses sem_clockwait() (GH-28662)

On Unix, if the sem_clockwait() function is available in the C
library (glibc 2.30 and newer), the threading.Lock.acquire() method
now uses the monotonic clock (time.CLOCK_MONOTONIC) for the timeout,
rather than using the system clock (time.CLOCK_REALTIME), to not be
affected by system clock changes.

configure now checks if the sem_clockwait() function is available.

4 years agoInstall the __phello__ package too. (#28665)
Eric Snow [Fri, 1 Oct 2021 02:23:32 +0000 (20:23 -0600)] 
Install the __phello__ package too. (#28665)

I broke some buildbots by not adding __phello__ to the list of installed packages.

https://bugs.python.org/issue45020

4 years agobpo-45020: Add more test cases for frozen modules. (gh-28664)
Eric Snow [Fri, 1 Oct 2021 00:38:52 +0000 (18:38 -0600)] 
bpo-45020: Add more test cases for frozen modules. (gh-28664)

I've added a number of test-only modules. Some of those cases are covered by the recently frozen stdlib modules (and some will be once we add encodings back in). However, I figured we'd play it safe by having a set of modules guaranteed to be there during tests.

https://bugs.python.org/issue45020

4 years agobpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654)
Serhiy Storchaka [Thu, 30 Sep 2021 16:20:39 +0000 (19:20 +0300)] 
bpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654)

* Work correctly if an additional fresh module imports other
  additional fresh module which imports a blocked module.
* Raises ImportError if the specified module cannot be imported
  while all additional fresh modules are successfully imported.
* Support blocking packages.
* Always restore the import state of fresh and blocked modules
  and their submodules.
* Fix test_decimal and test_xml_etree which depended on an undesired
  side effect of import_fresh_module().

4 years agoRevert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650)
Pablo Galindo Salgado [Thu, 30 Sep 2021 13:46:26 +0000 (14:46 +0100)] 
Revert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650)

This reverts commit d441437ee71ae174c008c23308b749b91020ba77.

4 years agobpo-41710: Document _PyTime_t API in pytime.h (GH-28647)
Victor Stinner [Thu, 30 Sep 2021 09:23:03 +0000 (11:23 +0200)] 
bpo-41710: Document _PyTime_t API in pytime.h (GH-28647)

4 years agobpo-41710: PyThread_acquire_lock_timed() clamps the timout (GH-28643)
Victor Stinner [Thu, 30 Sep 2021 08:16:51 +0000 (10:16 +0200)] 
bpo-41710: PyThread_acquire_lock_timed() clamps the timout (GH-28643)

PyThread_acquire_lock_timed() now clamps the timeout into the
[_PyTime_MIN; _PyTime_MAX] range (_PyTime_t type) if it is too large,
rather than calling Py_FatalError() which aborts the process.

PyThread_acquire_lock_timed() no longer uses
MICROSECONDS_TO_TIMESPEC() to compute sem_timedwait() argument, but
_PyTime_GetSystemClock() and _PyTime_AsTimespec_truncate().

Fix _thread.TIMEOUT_MAX value on Windows: the maximum timeout is
0x7FFFFFFF milliseconds (around 24.9 days), not 0xFFFFFFFF
milliseconds (around 49.7 days).

Set PY_TIMEOUT_MAX to 0x7FFFFFFF milliseconds, rather than 0xFFFFFFFF
milliseconds.

Fix PY_TIMEOUT_MAX overflow test: replace (us >= PY_TIMEOUT_MAX) with
(us > PY_TIMEOUT_MAX).

4 years agoFix EncodingWarning in freeze_modules. (GH-28591)
Inada Naoki [Thu, 30 Sep 2021 03:36:16 +0000 (12:36 +0900)] 
Fix EncodingWarning in freeze_modules. (GH-28591)

4 years agobpo-41710: Fix building pytime.c on Windows (GH-28644)
Victor Stinner [Thu, 30 Sep 2021 01:50:29 +0000 (03:50 +0200)] 
bpo-41710: Fix building pytime.c on Windows (GH-28644)

4 years agobpo-41710: Add pytime_add() and pytime_mul() (GH-28642)
Victor Stinner [Thu, 30 Sep 2021 01:07:11 +0000 (03:07 +0200)] 
bpo-41710: Add pytime_add() and pytime_mul() (GH-28642)

Add pytime_add() and pytime_mul() functions to pytime.c to compute
t+t2 and t*k with clamping to [_PyTime_MIN; _PyTime_MAX].

Fix pytime.h: _PyTime_FromTimeval() is not implemented on Windows.

4 years agobpo-41710: Add _PyTime_AsTimespec_clamp() (GH-28629)
Victor Stinner [Thu, 30 Sep 2021 00:11:41 +0000 (02:11 +0200)] 
bpo-41710: Add _PyTime_AsTimespec_clamp() (GH-28629)

Add the _PyTime_AsTimespec_clamp() function: similar to
_PyTime_AsTimespec(), but clamp to _PyTime_t min/max and don't raise
an exception.

PyThread_acquire_lock_timed() now uses _PyTime_AsTimespec_clamp() to
remove the Py_UNREACHABLE() code path.

* Add _PyTime_AsTime_t() function.
* Add PY_TIME_T_MIN and PY_TIME_T_MAX constants.
* Replace _PyTime_AsTimeval_noraise() with _PyTime_AsTimeval_clamp().
* Add pytime_divide_round_up() function.
* Fix integer overflow in pytime_divide().
* Add pytime_divmod() function.

4 years agobpo-43753: _operator.is_() uses Py_Is() (GH-28641)
Victor Stinner [Wed, 29 Sep 2021 23:28:10 +0000 (01:28 +0200)] 
bpo-43753: _operator.is_() uses Py_Is() (GH-28641)

4 years agobpo-45229: Make datetime tests discoverable (GH-28615)
Serhiy Storchaka [Wed, 29 Sep 2021 20:27:57 +0000 (23:27 +0300)] 
bpo-45229: Make datetime tests discoverable (GH-28615)

4 years agobpo-45020: Do not freeze <pkg>/__init__.py twice. (gh-28635)
Eric Snow [Wed, 29 Sep 2021 18:55:35 +0000 (12:55 -0600)] 
bpo-45020: Do not freeze <pkg>/__init__.py twice. (gh-28635)

Currently we're freezing the __init__.py twice, duplicating the built data unnecessarily With this change we do it once. There is no change in runtime behavior.

https://bugs.python.org/issue45020

4 years ago[typo] s/libexpact/libexpat/ in setup.py (GH-28624)
Łukasz Langa [Wed, 29 Sep 2021 14:29:35 +0000 (16:29 +0200)] 
[typo] s/libexpact/libexpat/ in setup.py (GH-28624)