]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agoFix spelling in Misc (GH-28858)
180909 [Tue, 12 Oct 2021 18:22:05 +0000 (02:22 +0800)] 
Fix spelling in Misc (GH-28858)

4 years agobpo-45421: Remove dead code from html.parser (GH-28847)
Alberto Mardegan [Tue, 12 Oct 2021 17:12:21 +0000 (20:12 +0300)] 
bpo-45421: Remove dead code from html.parser (GH-28847)

Support for HtmlParserError was removed back in 2014 with commit
73a4359eb0eb624c588c5d52083ea4944f9787ea, however this small block was
missed.

4 years agobpo-44991: Normalise function and collation callback naming (GH-28209)
Erlend Egeberg Aasland [Tue, 12 Oct 2021 11:38:49 +0000 (13:38 +0200)] 
bpo-44991: Normalise function and collation callback naming (GH-28209)

4 years agobpo-45441: Update some moved URLs in documentation (GH-28861)
180909 [Tue, 12 Oct 2021 10:36:14 +0000 (18:36 +0800)] 
bpo-45441: Update some moved URLs in documentation (GH-28861)

4 years agoSlight correct grammar (GH-28860)
nobodyatandnothing [Tue, 12 Oct 2021 09:29:29 +0000 (05:29 -0400)] 
Slight correct grammar (GH-28860)

4 years agoFix format string in _PyImport_LoadDynamicModuleWithSpec() (GH-28863)
Serhiy Storchaka [Tue, 12 Oct 2021 07:20:04 +0000 (10:20 +0300)] 
Fix format string in _PyImport_LoadDynamicModuleWithSpec() (GH-28863)

4 years agobpo-45439: Move _PyObject_CallNoArgs() to pycore_call.h (GH-28895)
Victor Stinner [Tue, 12 Oct 2021 06:38:19 +0000 (08:38 +0200)] 
bpo-45439: Move _PyObject_CallNoArgs() to pycore_call.h (GH-28895)

* Move _PyObject_CallNoArgs() to pycore_call.h (internal C API).
* _ssl, _sqlite and _testcapi extensions now call the public
  PyObject_CallNoArgs() function, rather than _PyObject_CallNoArgs().
* _lsprof extension is now built with Py_BUILD_CORE_MODULE macro
  defined to get access to internal _PyObject_CallNoArgs().

4 years agobpo-45433: Do not link libpython against libcrypt (GH-28881)
Mike Gilbert [Mon, 11 Oct 2021 23:24:03 +0000 (19:24 -0400)] 
bpo-45433: Do not link libpython against libcrypt (GH-28881)

Save/restore LIBS when calling AC_SEARCH_LIBS(..., crypt). This avoid
linking libpython with libcrypt.

4 years agobpo-45439: Rename _PyObject_CallNoArg() to _PyObject_CallNoArgs() (GH-28891)
Victor Stinner [Mon, 11 Oct 2021 22:42:23 +0000 (00:42 +0200)] 
bpo-45439: Rename _PyObject_CallNoArg() to _PyObject_CallNoArgs() (GH-28891)

Fix typo in the private _PyObject_CallNoArg() function name: rename
it to _PyObject_CallNoArgs() to be consistent with the public
function PyObject_CallNoArgs().

4 years agobpo-45439: _PyObject_Call() only checks tp_vectorcall_offset once (GH-28890)
Victor Stinner [Mon, 11 Oct 2021 22:18:26 +0000 (00:18 +0200)] 
bpo-45439: _PyObject_Call() only checks tp_vectorcall_offset once (GH-28890)

Add _PyVectorcall_Call() helper function.

Add "assert(PyCallable_Check(callable));" to PyVectorcall_Call(),
similar check than PyVectorcall_Function().

4 years agobpo-45412: Move copysign() define to pycore_pymath.h (GH-28889)
Victor Stinner [Mon, 11 Oct 2021 22:12:00 +0000 (00:12 +0200)] 
bpo-45412: Move copysign() define to pycore_pymath.h (GH-28889)

Move definitions of copysign(), round(), hypot(), fmod(), etc. from
pymath.h to pycore_pymath.h. These functions are not exported by
libpython and so must not be part of the C API.

4 years agobpo-41123: Remove Py_UNICODE_COPY() and Py_UNICODE_FILL() (GH-28887)
Victor Stinner [Mon, 11 Oct 2021 21:36:37 +0000 (23:36 +0200)] 
bpo-41123: Remove Py_UNICODE_COPY() and Py_UNICODE_FILL() (GH-28887)

4 years agobpo-45434: Python.h no longer includes <stdlib.h> (GH-28888)
Victor Stinner [Mon, 11 Oct 2021 21:30:00 +0000 (23:30 +0200)] 
bpo-45434: Python.h no longer includes <stdlib.h> (GH-28888)

4 years agobpo-45412: Move _Py_SET_53BIT_PRECISION_START to pycore_pymath.h (GH-28882)
Victor Stinner [Mon, 11 Oct 2021 21:09:40 +0000 (23:09 +0200)] 
bpo-45412: Move _Py_SET_53BIT_PRECISION_START to pycore_pymath.h (GH-28882)

Move the following macros , to pycore_pymath.h (internal C API):

* _Py_SET_53BIT_PRECISION_HEADER
* _Py_SET_53BIT_PRECISION_START
* _Py_SET_53BIT_PRECISION_END

PEP 7: add braces to if and "do { ... } while (0)" in these macros.

Move also _Py_get_387controlword() and _Py_set_387controlword()
definitions to pycore_pymath.h. These functions are no longer
exported.

pystrtod.c now includes pycore_pymath.h.

4 years agobpo-45412: Update _Py_ADJUST_ERANGE1() comment (GH-28884)
Victor Stinner [Mon, 11 Oct 2021 21:07:41 +0000 (23:07 +0200)] 
bpo-45412: Update _Py_ADJUST_ERANGE1() comment (GH-28884)

Copy the comment from the removed Py_OVERFLOWED() function.

4 years agobpo-45410: Add test.support.flush_std_streams() (GH-28885)
Victor Stinner [Mon, 11 Oct 2021 21:07:21 +0000 (23:07 +0200)] 
bpo-45410: Add test.support.flush_std_streams() (GH-28885)

support.print_warning() now flushs sys.stdout.

4 years agobpo-45434: Cleanup Python.h header file (GH-28883)
Victor Stinner [Mon, 11 Oct 2021 20:51:32 +0000 (22:51 +0200)] 
bpo-45434: Cleanup Python.h header file (GH-28883)

* Move limits.h include and UCHAR_MAX checks to pyport.h.
* Move sanitizers macros to pyport.h.
* Remove comment about <assert.h>: C extensions are built with NDEBUG
  automatically by Python.

4 years agobpo-45412: Remove Py_SET_ERRNO_ON_MATH_ERROR() macro (GH-28820)
Victor Stinner [Mon, 11 Oct 2021 19:00:25 +0000 (21:00 +0200)] 
bpo-45412: Remove Py_SET_ERRNO_ON_MATH_ERROR() macro (GH-28820)

Remove the following math macros using the errno variable:

* Py_ADJUST_ERANGE1()
* Py_ADJUST_ERANGE2()
* Py_OVERFLOWED()
* Py_SET_ERANGE_IF_OVERFLOW()
* Py_SET_ERRNO_ON_MATH_ERROR()

Create pycore_pymath.h internal header file.

Rename Py_ADJUST_ERANGE1() and Py_ADJUST_ERANGE2() to
_Py_ADJUST_ERANGE1() and _Py_ADJUST_ERANGE2(), and convert these
macros to static inline functions.

Move the following macros to pycore_pymath.h:

* _Py_IntegralTypeSigned()
* _Py_IntegralTypeMax()
* _Py_IntegralTypeMin()
* _Py_InIntegralTypeRange()

4 years agobpo-45351, asyncio: Enhance echo server example, print all addresses (GH-28828)
Olaf van der Spek [Mon, 11 Oct 2021 18:54:44 +0000 (20:54 +0200)] 
bpo-45351, asyncio: Enhance echo server example, print all addresses (GH-28828)

4 years agoHandle error when PyUnicode_GetLength returns a negative value. (GH-28859)
Dong-hee Na [Mon, 11 Oct 2021 11:08:38 +0000 (20:08 +0900)] 
Handle error when PyUnicode_GetLength returns a negative value. (GH-28859)

4 years agobpo-20028: Empty escapechar/quotechar is not allowed for csv.Dialect (GH-28833)
Dong-hee Na [Mon, 11 Oct 2021 11:08:15 +0000 (20:08 +0900)] 
bpo-20028: Empty escapechar/quotechar is not allowed for csv.Dialect (GH-28833)

4 years agobpo-45411: Update mimetypes.py (GH-28792)
Josephine-Marie [Mon, 11 Oct 2021 11:05:28 +0000 (13:05 +0200)] 
bpo-45411: Update mimetypes.py (GH-28792)

.vtt and .srt files are common subtitle files, used by browsers.

4 years agobpo-42253: Update xml.dom.minidom.rst (GH-23126)
Jens Diemer [Mon, 11 Oct 2021 10:42:05 +0000 (12:42 +0200)] 
bpo-42253: Update xml.dom.minidom.rst (GH-23126)

Document that the "standalone" parameter was added in Python 3.9.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agoRestore PEP 523 functionality. (GH-28871)
Mark Shannon [Mon, 11 Oct 2021 10:34:02 +0000 (11:34 +0100)] 
Restore PEP 523 functionality. (GH-28871)

4 years agoFix a leak in _PyImport_LoadDynamicModuleWithSpec() after failing PySys_Audit() ...
Serhiy Storchaka [Mon, 11 Oct 2021 08:57:27 +0000 (11:57 +0300)] 
Fix a leak in _PyImport_LoadDynamicModuleWithSpec() after failing PySys_Audit() (GH-28862)

4 years agobpo-45401: Fix a resource warning in test_logging (GH-28864)
Serhiy Storchaka [Mon, 11 Oct 2021 08:54:44 +0000 (11:54 +0300)] 
bpo-45401: Fix a resource warning in test_logging (GH-28864)

4 years agobpo-45416: Fix use of asyncio.Condition() with explicit Lock objects (GH-28850)
Joongi Kim [Sun, 10 Oct 2021 16:01:41 +0000 (01:01 +0900)] 
bpo-45416: Fix use of asyncio.Condition() with explicit Lock objects (GH-28850)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-45401: Change shouldRollover() methods to only rollover regular f… (GH-28822)
Vinay Sajip [Sun, 10 Oct 2021 15:15:24 +0000 (16:15 +0100)] 
bpo-45401: Change shouldRollover() methods to only rollover regular f… (GH-28822)

…iles.

Also changed some historical return values from 1 -> True and 0 -> False.

4 years agoFix class pattern docs to refer to class patterns (GH-28849)
Christophe Nanteuil [Sun, 10 Oct 2021 14:12:51 +0000 (16:12 +0200)] 
Fix class pattern docs to refer to class patterns (GH-28849)

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)