]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agoIncreased test coverage of calendar module
Rohit Mediratta [Sun, 1 Nov 2015 08:02:39 +0000 (01:02 -0700)] 
Increased test coverage of calendar module

3 years agoDocument LOAD_FAST_CHECK opcode (#93498)
Dennis Sweeney [Sun, 5 Jun 2022 15:24:09 +0000 (11:24 -0400)] 
Document LOAD_FAST_CHECK opcode (#93498)

3 years agogh-89973: Fix re.error in the fnmatch module. (GH-93072)
Serhiy Storchaka [Sun, 5 Jun 2022 08:46:29 +0000 (11:46 +0300)] 
gh-89973: Fix re.error in the fnmatch module. (GH-93072)

Character ranges with upper bound less that lower bound (e.g. [c-a])
are now interpreted as empty ranges, for compatibility with other glob
pattern implementations. Previously it was re.error.

3 years agogh-90473: wasmtime does not support absolute symlinks (GH-93490)
Christian Heimes [Sun, 5 Jun 2022 07:59:47 +0000 (09:59 +0200)] 
gh-90473: wasmtime does not support absolute symlinks (GH-93490)

3 years agogh-93442: Add test for _Py_CAST(nullptr). (gh-93505)
Neil Schemenauer [Sun, 5 Jun 2022 03:53:16 +0000 (20:53 -0700)] 
gh-93442: Add test for _Py_CAST(nullptr). (gh-93505)

3 years agogh-93442: Make C++ version of _Py_CAST work with 0/NULL. (#93500)
Neil Schemenauer [Sun, 5 Jun 2022 01:49:39 +0000 (18:49 -0700)] 
gh-93442: Make C++ version of _Py_CAST work with 0/NULL. (#93500)

Add C++ overloads for _Py_CAST_impl() to handle 0/NULL.  This will allow
C++ extensions that pass 0 or NULL to macros using _Py_CAST() to
continue to compile.  Without this, you get an error like:

    invalid ‘static_cast’ from type ‘int’ to type ‘_object*’

The modern way to use a NULL value in C++ is to use nullptr.  However,
we want to not break extensions that do things the old way.

Co-authored-by: serge-sans-paille
3 years ago[doc] Correct a grammatical error in a docstring. (GH-93441)
Colin Delahunty [Sat, 4 Jun 2022 16:42:08 +0000 (12:42 -0400)] 
[doc] Correct a grammatical error in a docstring. (GH-93441)

3 years agoFix missing word in sys.float_info docstring (GH-93489)
Mark Dickinson [Sat, 4 Jun 2022 16:28:14 +0000 (17:28 +0100)] 
Fix missing word in sys.float_info docstring (GH-93489)

3 years agogh-92886: Fix test that fails when running with `-O` in `test_imaplib.py` (#93237)
jackh-ncl [Sat, 4 Jun 2022 03:15:58 +0000 (04:15 +0100)] 
gh-92886: Fix test that fails when running with `-O` in `test_imaplib.py` (#93237)

3 years agonetrc: Remove unused "import shlex" (#93311)
Ulises Ojeda [Sat, 4 Jun 2022 03:14:58 +0000 (05:14 +0200)] 
netrc: Remove unused "import shlex" (#93311)

3 years agoGH-93444: remove redundant fields from basicblock: b_nofallthrough, b_exit, b_return...
Irit Katriel [Fri, 3 Jun 2022 21:43:22 +0000 (22:43 +0100)] 
GH-93444: remove redundant fields from basicblock: b_nofallthrough, b_exit, b_return (GH-93445)

3 years agogh-93156 - fix negative indexing into absolute `pathlib.PurePath().parents` (GH-93273)
Barney Gale [Fri, 3 Jun 2022 21:33:20 +0000 (22:33 +0100)] 
gh-93156 - fix negative indexing into absolute `pathlib.PurePath().parents` (GH-93273)

When a `_PathParents` object has a drive or a root, the length of the
object is *one less* than than the length of `self._parts`, which resulted
in an off-by-one error when `path.parents[-n]` was fed through to
`self._parts[:-n - 1]`. In particular, `path.parents[-1]` was a malformed
path object with spooky properties.

This is addressed by adding `len(self)` to negative indices.

3 years agogh-84461: Skip dtrace/network tests that are enabled by -u all (GH-93473)
Christian Heimes [Fri, 3 Jun 2022 20:14:31 +0000 (22:14 +0200)] 
gh-84461: Skip dtrace/network tests that are enabled by -u all (GH-93473)

3 years agogh-93382: Cache result of `PyCode_GetCode` in codeobject (GH-93383)
Ken Jin [Fri, 3 Jun 2022 16:41:18 +0000 (00:41 +0800)] 
gh-93382: Cache result of `PyCode_GetCode` in codeobject (GH-93383)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
3 years agotest.pythoninfo: Fix typo, Py_REF_DEBUG => Py_TRACE_REFS (#93467)
Victor Stinner [Fri, 3 Jun 2022 13:46:41 +0000 (15:46 +0200)] 
test.pythoninfo: Fix typo, Py_REF_DEBUG => Py_TRACE_REFS (#93467)

3 years agogh-93433: Fix dis doc example output (GH-93434)
Ken Jin [Fri, 3 Jun 2022 10:02:58 +0000 (18:02 +0800)] 
gh-93433: Fix dis doc example output (GH-93434)

3 years agogh-68966: Make mailcap refuse to match unsafe filenames/types/params (GH-91993)
Petr Viktorin [Fri, 3 Jun 2022 09:43:35 +0000 (11:43 +0200)] 
gh-68966: Make mailcap refuse to match unsafe filenames/types/params (GH-91993)

3 years agoremove redundant argument to log_helper (GH-93440)
Pieter Eendebak [Fri, 3 Jun 2022 07:40:05 +0000 (09:40 +0200)] 
remove redundant argument to log_helper (GH-93440)

3 years agogh-92932: dis._unpack_opargs should handle EXTENDED_ARG_QUICK (gh-92945)
Dong-hee Na [Fri, 3 Jun 2022 02:29:27 +0000 (11:29 +0900)] 
gh-92932: dis._unpack_opargs should handle EXTENDED_ARG_QUICK (gh-92945)

3 years agogh-91320: Fix more old-style cast warnings in C++ (#93285)
Victor Stinner [Thu, 2 Jun 2022 22:59:57 +0000 (00:59 +0200)] 
gh-91320: Fix more old-style cast warnings in C++ (#93285)

Use _PyObject_CAST() in the public C API to fix C++ compiler
warnings: "use of old-style cast" (clang -Wold-style-cast).

3 years agogh-90473: Skip and document more failing tests on WASI (GH-93436)
Christian Heimes [Thu, 2 Jun 2022 22:44:48 +0000 (00:44 +0200)] 
gh-90473: Skip and document more failing tests on WASI (GH-93436)

- Mark more ``umask()`` cases
- ``dup()`` is not supported
- ``/dev/null`` is not available
- document missing features
- mark more modules as not available

3 years agogh-93356: Lay out exception handling code at end of code unit (GH-92769)
Irit Katriel [Thu, 2 Jun 2022 13:13:43 +0000 (14:13 +0100)] 
gh-93356: Lay out exception handling code at end of code unit  (GH-92769)

3 years agogh-84461: Skip new async logging tests on Emscripten (GH-93427)
Christian Heimes [Thu, 2 Jun 2022 07:35:06 +0000 (09:35 +0200)] 
gh-84461: Skip new async logging tests on Emscripten (GH-93427)

3 years agogh-93418: Fix an assert when an f-string expression is followed by an '=', but no...
Eric V. Smith [Wed, 1 Jun 2022 23:20:06 +0000 (19:20 -0400)] 
gh-93418: Fix an assert when an f-string expression is followed by an '=', but no closing brace. (gh-93419)

3 years agogh-92597: Improve error message for AST nodes with invalid ranges (GH-93398) 93420/head
Pablo Galindo Salgado [Wed, 1 Jun 2022 12:51:17 +0000 (13:51 +0100)] 
gh-92597: Improve error message for AST nodes with invalid ranges (GH-93398)

3 years agogh-90300: split --help output into separate options (#30331)
Éric [Wed, 1 Jun 2022 09:50:01 +0000 (05:50 -0400)] 
gh-90300: split --help output into separate options (#30331)

Make --help output shorter and add new help options.

--help-env, --help-xoptions and --help-all command-line options are
added to complement --help.

3 years ago[doc] Improve discoverability of links between logging documents. (GH-93405)
Vinay Sajip [Wed, 1 Jun 2022 07:29:13 +0000 (08:29 +0100)] 
[doc] Improve discoverability of links between logging documents. (GH-93405)

3 years agoRemove the execution bit to some socket-related files. (#93368)
Ezio Melotti [Wed, 1 Jun 2022 07:11:46 +0000 (09:11 +0200)] 
Remove the execution bit to some socket-related files. (#93368)

3 years agogh-93372: Fix typo in os.rename documentation (GH-93401)
Wei-Ting Yang [Wed, 1 Jun 2022 06:54:31 +0000 (14:54 +0800)] 
gh-93372: Fix typo in os.rename documentation (GH-93401)

3 years ago📝 Make sure the phrase "constant-time compare" actually appears in the docs (GH-93396)
Noah Kantrowitz [Wed, 1 Jun 2022 01:35:28 +0000 (18:35 -0700)] 
📝 Make sure the phrase "constant-time compare" actually appears in the docs (GH-93396)

This is purely for SEO as this is the actual generic name for this kind of method and it currently does not appear in a Google search for "python constant time compare". Not creating an issue or setting this up for backports as its trivial (I think) and not a functional change.

3 years agogh-92597: Ensure that AST nodes without explicit end positions can be compiled (GH...
Pablo Galindo Salgado [Tue, 31 May 2022 23:00:47 +0000 (00:00 +0100)] 
gh-92597: Ensure that AST nodes without explicit end positions can be compiled (GH-93359)

3 years agogh-93391: fix typo in `array` docs (GH-93392)
ynfle [Tue, 31 May 2022 21:52:03 +0000 (00:52 +0300)] 
gh-93391: fix typo in `array` docs (GH-93392)

Fixes #93391

Automerge-Triggered-By: GH:rhettinger
3 years ago[doc] logging.rst - Change link to point directly to the Google Group. (GH-93390)
Moshe Kaplan [Tue, 31 May 2022 21:46:52 +0000 (17:46 -0400)] 
[doc] logging.rst - Change link to point directly to the Google Group. (GH-93390)

3 years agogh-93143: Avoid NULL check in LOAD_FAST based on analysis in the compiler (GH-93144)
Dennis Sweeney [Tue, 31 May 2022 20:32:30 +0000 (16:32 -0400)] 
gh-93143: Avoid NULL check in LOAD_FAST based on analysis in the compiler (GH-93144)

3 years agogh-69093: Fix Setup.local.in rule for _sqlite3 (GH-93380)
Christian Heimes [Tue, 31 May 2022 19:23:49 +0000 (21:23 +0200)] 
gh-69093: Fix Setup.local.in rule for _sqlite3 (GH-93380)

3 years agogh-93283: Improve error message for f-string with invalid conversion character (GH...
Serhiy Storchaka [Tue, 31 May 2022 17:38:29 +0000 (20:38 +0300)] 
gh-93283: Improve error message for f-string with invalid conversion character (GH-93349)

3 years agoRemove VOC reference (93333)
Carl Bordum Hansen [Tue, 31 May 2022 17:29:21 +0000 (19:29 +0200)] 
Remove VOC reference (93333)

VOC has been archived by the BeeWare project, and they are instead
embedding CPython, rather than transpiling to Java bytecode.

3 years agoGH-93354: Use exponential backoff to avoid excessive specialization attempts. (GH...
Mark Shannon [Tue, 31 May 2022 10:58:26 +0000 (11:58 +0100)] 
GH-93354: Use exponential backoff to avoid excessive specialization attempts. (GH-93355)

3 years agoGH-93312: Add os.PIDFD_NONBLOCK flag (#93313)
Kumar Aditya [Tue, 31 May 2022 10:51:29 +0000 (16:21 +0530)] 
GH-93312: Add os.PIDFD_NONBLOCK flag (#93313)

3 years agogh-93345: Fix a crash in substitution of nested TypeVar after TypeVarTuple (GH-93346)
Serhiy Storchaka [Tue, 31 May 2022 05:46:16 +0000 (08:46 +0300)] 
gh-93345: Fix a crash in substitution of nested TypeVar after TypeVarTuple (GH-93346)

For example: tuple[*Ts, list[T]][int, str, bool]

3 years agogh-93351: Ensure the position information in AST nodes created by the parser is alway...
Pablo Galindo Salgado [Mon, 30 May 2022 18:30:15 +0000 (14:30 -0400)] 
gh-93351: Ensure the position information in AST nodes created by the parser is always consistent (GH-93352)

3 years agobpo-42272: fix misleading warning filter message/module docs (#23172)
Kevin Locke [Mon, 30 May 2022 01:43:32 +0000 (01:43 +0000)] 
bpo-42272: fix misleading warning filter message/module docs (#23172)

* bpo-42272: improve message/module warning filter docs

"The Warnings Filter" section of the warnings module documentation
describes the message and module filters as "a string containing a
regular expression".  While that is true when they are arguments to the
filterwarnings function, it is not true when they appear in -W or
$PYTHONWARNINGS where they are matched literally (after stripping any
starting/ending whitespace).  Update the documentation to note when they
are matched literally.  Also clarify that module matches the
"fully-qualified module name", rather than "module name" which is
ambiguous.

skip news (since this is a doc fix)

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
* bpo-42272: remove bad submodule warning filter doc

The `error:::mymodule[.*]` example in the "Describing Warning Filters"
section of the warnings module documentation does not behave as the
comment describes.  Since the module portion of the filter string is
interpreted literally, it would match a module with a fully-qualified
name that is literally `mymodule[.*]`.

Unfortunately, there is not a way to match '"module" and any subpackages
of "mymodule"' as documented, since the module part of a filter string
is matched literally.  Instead, update the filter and comment to match
only "mymodule".

skip news (since this is a doc fix)

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
* bpo-42272: add warning filter doc changes to NEWS

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
3 years agoFix typo in Lib/idlelib/idle_test/test_parenmatch.py (GH-93332)
luzpaz [Mon, 30 May 2022 01:41:59 +0000 (21:41 -0400)] 
Fix typo in Lib/idlelib/idle_test/test_parenmatch.py (GH-93332)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
3 years agogh-93244: Document Py_PRINT_RAW in PyObject_Print() comment (93245)
Will Hawkins [Sun, 29 May 2022 17:18:52 +0000 (13:18 -0400)] 
gh-93244: Document Py_PRINT_RAW in PyObject_Print() comment (93245)

3 years agogh-93008: refactor compiler functions that add instructions to take only a basicblock...
Irit Katriel [Sun, 29 May 2022 16:13:29 +0000 (17:13 +0100)] 
gh-93008: refactor compiler functions that add instructions to take only a basicblock* (not the whole compiler) (GH-93009)

3 years agobpo-41287: Handle `doc` argument of `property.__init__` in subclasses (#23205)
Sergei Izmailov [Sun, 29 May 2022 03:25:51 +0000 (06:25 +0300)] 
bpo-41287: Handle `doc` argument of `property.__init__` in subclasses (#23205)

Fixes #85459

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-92240 : Include release dates for "What's New In Python 3.X" (#92937)
georgically [Sun, 29 May 2022 03:24:35 +0000 (10:24 +0700)] 
gh-92240 : Include release dates for "What's New In Python 3.X" (#92937)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
3 years agoRevert "gh-84508: Add mapping files for Korean and Japanese. (gh-93309)" (#93320)
Dong-hee Na [Sun, 29 May 2022 00:49:19 +0000 (09:49 +0900)] 
Revert "gh-84508: Add mapping files for Korean and Japanese. (gh-93309)" (#93320)

This reverts commit dec1e9346d82fa4a4761389c81d36ef9d01f332b.

3 years agogh-92727: Add example of named group in doc for re.Match.__getitem__ (#92730)
Baptiste Mispelon [Sat, 28 May 2022 18:11:08 +0000 (20:11 +0200)] 
gh-92727: Add example of named group in doc for re.Match.__getitem__ (#92730)

3 years agogh-92839: fixed typo in _bisectmodule.c (line 131) (#92849)
oda-gitso [Sat, 28 May 2022 18:08:06 +0000 (01:08 +0700)] 
gh-92839: fixed typo in _bisectmodule.c (line 131) (#92849)

3 years agogh-84508: Add mapping files for Korean and Japanese. (gh-93309)
Dong-hee Na [Sat, 28 May 2022 03:32:00 +0000 (12:32 +0900)] 
gh-84508: Add mapping files for Korean and Japanese. (gh-93309)

3 years agobpo-40514: Drop EXPERIMENTAL_ISOLATED_SUBINTERPRETERS (gh-93185)
Eric Snow [Fri, 27 May 2022 23:38:01 +0000 (17:38 -0600)] 
bpo-40514: Drop EXPERIMENTAL_ISOLATED_SUBINTERPRETERS (gh-93185)

This was added for bpo-40514 (gh-84694) to test out a per-interpreter GIL. However, it has since proven unnecessary to keep the experiment in the repo. (It can be done as a branch in a fork like normal.) So here we are removing:

* the configure option
* the macro
* the code enabled by the macro

3 years agogh-93297: Make asyncio task groups prevent child tasks from being GCed (#93299)
Yury Selivanov [Fri, 27 May 2022 22:20:21 +0000 (15:20 -0700)] 
gh-93297: Make asyncio task groups prevent child tasks from being GCed (#93299)

3 years agogh-93250: [Enum] Change IntEnum boundary to KEEP for backwards compatibility (GH...
Ethan Furman [Fri, 27 May 2022 22:14:28 +0000 (15:14 -0700)] 
gh-93250: [Enum] Change IntEnum boundary to KEEP for backwards compatibility (GH-93302)

In previous versions of Python if an IntEnum member was combined with another integer type value using a bit-wise operation, the resulting value would still be the IntEnum type.  This change restores that behavior.

3 years agogh-91243: Document Required and NotRequired (#93173)
David Foster [Fri, 27 May 2022 22:11:45 +0000 (16:11 -0600)] 
gh-91243: Document Required and NotRequired (#93173)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
3 years agobpo-46951: Order contents of zipapps (GH-31713)
hfinucane [Fri, 27 May 2022 16:04:29 +0000 (09:04 -0700)] 
bpo-46951: Order contents of zipapps (GH-31713)

So that builds are more reproducible.

3 years agoGH-90230: Add stats to breakdown the origin of calls to `PyEval_EvalFrame` (GH-93284)
Mark Shannon [Fri, 27 May 2022 15:31:41 +0000 (16:31 +0100)] 
GH-90230: Add stats to breakdown the origin of calls to `PyEval_EvalFrame` (GH-93284)

3 years agogh-77024: test.support: Improve documentation (#92513)
Jelle Zijlstra [Fri, 27 May 2022 14:16:25 +0000 (07:16 -0700)] 
gh-77024: test.support: Improve documentation (#92513)

This is a rework of #5774 on current main. I was a bit more
conservative in making changes than the original PR.

See @csabella's comments on issue #77024 and the discussion
on #5774 for explanations of several of the changes.

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
3 years agogh-82616: Add Py_IS_TYPE_SIGNED() macro (#93178)
Victor Stinner [Fri, 27 May 2022 13:05:35 +0000 (15:05 +0200)] 
gh-82616: Add Py_IS_TYPE_SIGNED() macro (#93178)

_posixsubprocess: add a static assertion to ensure that the pid_t
type is signed.

Replace _Py_IntegralTypeSigned() with _Py_IS_TYPE_SIGNED().

3 years agoGH-93207: Remove HAVE_STDARG_PROTOTYPES configure check for stdarg.h (#93215)
Kumar Aditya [Fri, 27 May 2022 11:30:45 +0000 (17:00 +0530)] 
GH-93207: Remove HAVE_STDARG_PROTOTYPES configure check for stdarg.h (#93215)

3 years agogh-93223: More aggressive Jump-To-Jump elimination (GH-93229)
Dennis Sweeney [Fri, 27 May 2022 10:17:59 +0000 (06:17 -0400)] 
gh-93223: More aggressive Jump-To-Jump elimination (GH-93229)

3 years agogh-60074: add new stable API function PyType_FromMetaclass (GH-93012)
Wenzel Jakob [Fri, 27 May 2022 08:27:39 +0000 (10:27 +0200)] 
gh-60074: add new stable API function PyType_FromMetaclass (GH-93012)

Added a new stable API function ``PyType_FromMetaclass``, which mirrors
the behavior of ``PyType_FromModuleAndSpec`` except that it takes an
additional metaclass argument. This is, e.g., useful for language
binding tools that need to store additional information in the type
object.

3 years agogh-92898: Enhance _testcppext test on cast to PyObject* (#93111)
Victor Stinner [Thu, 26 May 2022 23:12:39 +0000 (01:12 +0200)] 
gh-92898: Enhance _testcppext test on cast to PyObject* (#93111)

* Add StrongRef class.
* Rename and reformat functions of the _Py_CAST() implementation.

3 years agogh-91924: Optimize unicode_check_encoding_errors() (#93200)
Victor Stinner [Thu, 26 May 2022 22:39:49 +0000 (00:39 +0200)] 
gh-91924: Optimize unicode_check_encoding_errors() (#93200)

Avoid _PyCodec_Lookup() and PyCodec_LookupError() for most common
built-in encodings and error handlers to avoid creating a temporary
Unicode string object, whereas these encodings and error handlers are
known to be valid.

3 years agogh-91513: Tidied up a test and did minor refactoring around test filename gener…...
Vinay Sajip [Thu, 26 May 2022 16:11:15 +0000 (17:11 +0100)] 
gh-91513: Tidied up a test and did minor refactoring around test filename gener… (GH-93265)

3 years agogh-93217: fix some issues in man page and --help (#93219)
Éric [Thu, 26 May 2022 14:31:39 +0000 (10:31 -0400)] 
gh-93217: fix some issues in man page and --help (#93219)

3 years agotest.pythoninfo logs more build info (#93225)
Victor Stinner [Thu, 26 May 2022 14:07:01 +0000 (16:07 +0200)] 
test.pythoninfo logs more build info (#93225)

Log also test.support.check_sanitizer() values.

3 years agogh-91513: Add 'asyncio' taskName to logging LogRecord attributes. (GH-93193)
jackh-ncl [Thu, 26 May 2022 08:30:51 +0000 (09:30 +0100)] 
gh-91513: Add 'asyncio' taskName to logging LogRecord attributes. (GH-93193)

3 years agogh-69443: Add test.support.Py_DEBUG constant (#93226)
Victor Stinner [Wed, 25 May 2022 22:12:54 +0000 (00:12 +0200)] 
gh-69443: Add test.support.Py_DEBUG constant (#93226)

3 years agogh-93005: Fix py.exe launcher test to search for intended tag (GH-93190)
Steve Dower [Wed, 25 May 2022 21:59:33 +0000 (22:59 +0100)] 
gh-93005: Fix py.exe launcher test to search for intended tag (GH-93190)

3 years agogh-90817: Deprecate explicitly locale.resetlocale() (#93196)
Victor Stinner [Wed, 25 May 2022 20:04:06 +0000 (22:04 +0200)] 
gh-90817: Deprecate explicitly locale.resetlocale() (#93196)

The function was already deprecated in Python 3.11 since it calls
locale.getdefaultlocale() which was deprecated in Python 3.11.

3 years agoRemove unnecessary for loop initializer in long_lshift1() (GH-93071)
oda-gitso [Wed, 25 May 2022 17:57:33 +0000 (00:57 +0700)] 
Remove unnecessary for loop initializer in long_lshift1() (GH-93071)

* Remove unnecessary for loop initialization.

3 years agogh-93172: Remove unnecessary "if"s in binascii_a2b_qp_impl() from Modules/binascii...
oda-gitso [Wed, 25 May 2022 15:38:47 +0000 (22:38 +0700)] 
gh-93172: Remove unnecessary "if"s in binascii_a2b_qp_impl() from Modules/binascii.c (GH-93181)

3 years agogh-93124: Fix typos in comments (GH-93125)
Akuli [Wed, 25 May 2022 15:34:14 +0000 (18:34 +0300)] 
gh-93124: Fix typos in comments (GH-93125)

Fixes #93124

Automerge-Triggered-By: GH:rhettinger
3 years agogh-90473: Misc test fixes for WASI (GH-93218)
Christian Heimes [Wed, 25 May 2022 13:57:26 +0000 (15:57 +0200)] 
gh-90473: Misc test fixes for WASI (GH-93218)

* ``sys.executable`` is not set
* WASI does not support subprocess
* ``pwd`` module is not available
* WASI checks ``open`` syscall flags more strict, needs r, w, rw flag.
* ``umask`` is not available
* ``/dev/null`` may not be accessible

3 years agogh-92777: Add LOAD_METHOD_LAZY_DICT (GH-92778)
Ken Jin [Wed, 25 May 2022 13:06:15 +0000 (21:06 +0800)] 
gh-92777: Add LOAD_METHOD_LAZY_DICT (GH-92778)

3 years agogh-93117: Remove too large sqlite3 bigmemtest (#93154)
Erlend Egeberg Aasland [Wed, 25 May 2022 12:53:26 +0000 (14:53 +0200)] 
gh-93117: Remove too large sqlite3 bigmemtest (#93154)

3 years agogh-93202: Always use %zd printf formatter (#93201)
Victor Stinner [Wed, 25 May 2022 12:21:36 +0000 (14:21 +0200)] 
gh-93202: Always use %zd printf formatter (#93201)

Python now always use the ``%zu`` and ``%zd`` printf formats to
format a size_t or Py_ssize_t number. Building Python 3.12 requires a
C11 compiler, so these printf formats are now always supported.

* PyObject_Print() and _PyObject_Dump() now use the printf %zd format
  to display an object reference count.
* Update PY_FORMAT_SIZE_T comment.
* Remove outdated notes about the %zd format in PyBytes_FromFormat()
  and PyUnicode_FromFormat() documentations.
* configure no longer checks for the %zd format and no longer defines
  PY_FORMAT_SIZE_T macro in pyconfig.h.
* pymacconfig.h no longer undefines PY_FORMAT_SIZE_T: macOS 10.4 is
  no longer supported. Python 3.12 now requires macOS 10.6 (Snow
  Leopard) or newer.

3 years agogh-93040 Wrap unused parameters in Objects/obmalloc.c with Py_UNUSED (#93175)
oda-gitso [Wed, 25 May 2022 10:39:06 +0000 (17:39 +0700)] 
gh-93040 Wrap unused parameters in Objects/obmalloc.c with Py_UNUSED (#93175)

3 years agogh-91924: Fix __lltrace__ for non-UTF-8 stdout encoding (#93199)
Victor Stinner [Wed, 25 May 2022 09:45:33 +0000 (11:45 +0200)] 
gh-91924: Fix __lltrace__ for non-UTF-8 stdout encoding (#93199)

Fix __lltrace__ debug feature if the stdout encoding is not UTF-8.

If the stdout encoding is not UTF-8, the first call to
lltrace_resume_frame() indirectly sets lltrace to 0 when calling
unicode_check_encoding_errors() which calls
encodings.search_function().

3 years agotest_threaded_import: Fix unittest.main spelling (GH-93114)
Florian Bruhin [Wed, 25 May 2022 07:59:32 +0000 (09:59 +0200)] 
test_threaded_import: Fix unittest.main spelling (GH-93114)

3 years agogh-92728: Restore re.template, but deprecate it (GH-93161)
Miro Hrončok [Wed, 25 May 2022 06:05:35 +0000 (08:05 +0200)] 
gh-92728: Restore re.template, but deprecate it (GH-93161)

Revert "bpo-47211: Remove function re.template() and flag re.TEMPLATE (GH-32300)"

This reverts commit b09184bf05b07b77c5ecfedd4daa846be3cbf0a9.

3 years agogh-92658: AF_HYPERV is only supported on Windows (#93192)
Victor Stinner [Wed, 25 May 2022 02:44:57 +0000 (04:44 +0200)] 
gh-92658: AF_HYPERV is only supported on Windows (#93192)

Only build the AF_HYPERV support on Windows for the _socket extension.
FreeBSD defines the AF_HYPERV macro but doesn't have the SOCKADDR_HV
type.

3 years agogh-92434: Silence a compiler warning in _xxsubinterpretersmodule.c for 32bit version...
neonene [Wed, 25 May 2022 01:22:39 +0000 (10:22 +0900)] 
gh-92434: Silence a compiler warning in _xxsubinterpretersmodule.c for 32bit version (gh-93091)

3 years agogh-93035: [Enum] Fix IntFlag crash when no single-bit members (GH-93076)
Tobin Yehle [Wed, 25 May 2022 01:16:20 +0000 (19:16 -0600)] 
gh-93035: [Enum] Fix IntFlag crash when no single-bit members (GH-93076)

`EnumType` attempts to create a custom docstring for each enum/flag, but that was failing with pathological flags that had no members (only multi-bit aliases).

3 years agotest.pythoninfo no longer requires socket (#93191)
Victor Stinner [Wed, 25 May 2022 00:11:51 +0000 (02:11 +0200)] 
test.pythoninfo no longer requires socket (#93191)

test.pythoninfo no longer fails if "import socket" fails: the socket
module is now optional.

3 years agogh-93103: Py_DecodeLocale() uses _PyRuntime.preconfig (#93187)
Victor Stinner [Tue, 24 May 2022 22:09:48 +0000 (00:09 +0200)] 
gh-93103: Py_DecodeLocale() uses _PyRuntime.preconfig (#93187)

The Py_DecodeLocale() and Py_EncodeLocale() now use
_PyRuntime.preconfig, rather than Py_UTF8Mode and
Py_LegacyWindowsFSEncodingFlag global configuration varibles, to
decide if the UTF-8 encoding is used or not.

As documented, these functions must not be called before Python is
preinitialized. The new PyConfig API should now be used, rather than
using deprecated functions like Py_SetPath() or PySys_SetArgv().

3 years agogh-93103: Enhance PyConfig.parser_debug documentation (#93186)
Victor Stinner [Tue, 24 May 2022 21:23:01 +0000 (23:23 +0200)] 
gh-93103: Enhance PyConfig.parser_debug documentation (#93186)

Document that -d option and PYTHONDEBUG env var require a debug
build of Python. Also mention them in the debug build documentation.

3 years agogh-92658: Add Hyper-V socket support (GH-92755)
Jordan Borean [Tue, 24 May 2022 20:37:06 +0000 (06:37 +1000)] 
gh-92658: Add Hyper-V socket support (GH-92755)

3 years agogh-93103: Parser uses PyConfig.parser_debug instead of Py_DebugFlag (#93106)
Victor Stinner [Tue, 24 May 2022 20:35:08 +0000 (22:35 +0200)] 
gh-93103: Parser uses PyConfig.parser_debug instead of Py_DebugFlag (#93106)

* Replace deprecated Py_DebugFlag with PyConfig.parser_debug in the
  parser.
* Add Parser.debug member.
* Add tok_state.debug member.
* Py_FrozenMain(): Replace Py_VerboseFlag with PyConfig.verbose.

3 years agoGH-89369: test_contextlib_async finalizes event loop after each test (#93074)
Kumar Aditya [Tue, 24 May 2022 13:41:32 +0000 (19:11 +0530)] 
GH-89369: test_contextlib_async finalizes event loop after each test (#93074)

Use asyncio.run().

3 years agoGH-93112: Fix missing ResourceDenied import in test_urllib2net (#93113)
Florian Bruhin [Tue, 24 May 2022 12:09:52 +0000 (14:09 +0200)] 
GH-93112: Fix missing ResourceDenied import in test_urllib2net (#93113)

The code was moved out of test.support in
311110abcd8ab648dbf1803e36a8ba5d93fa019b (GH-20812), thus making
ResourceDenied undefined.

3 years agogh-93033: Use wmemchr in stringlib (GH-93034)
goldsteinn [Tue, 24 May 2022 01:45:31 +0000 (20:45 -0500)] 
gh-93033: Use wmemchr in stringlib (GH-93034)

Generally comparable perf for the "good" case where memchr doesn't
return any collisions (false matches on lower byte) but clearly faster
with collisions.

3 years agogh-93099: Fix _pyio to use locale module properly (gh-93136)
Dong-hee Na [Tue, 24 May 2022 00:37:01 +0000 (09:37 +0900)] 
gh-93099: Fix _pyio to use locale module properly (gh-93136)

3 years agoDoc: No need to use rst syntax in code comments. (GH-93102)
Julien Palard [Mon, 23 May 2022 21:45:16 +0000 (23:45 +0200)] 
Doc: No need to use rst syntax in code comments. (GH-93102)

And it raises `make suspicious` false positives.

3 years agogh-92859: Doc: add info about logging.debug() calling basicConfig() (GH-93063)
Nicolas Haller [Mon, 23 May 2022 19:18:43 +0000 (15:18 -0400)] 
gh-92859: Doc: add info about logging.debug() calling basicConfig() (GH-93063)

3 years agogh-93065: Fix HAMT to iterate correctly over 7-level deep trees (GH-93066)
Yury Selivanov [Mon, 23 May 2022 19:09:59 +0000 (12:09 -0700)] 
gh-93065: Fix HAMT to iterate correctly over 7-level deep trees (GH-93066)

Also while there, clarify a few things about why we reduce the hash to 32 bits.

Co-authored-by: Eli Libman <eli@hyro.ai>
Co-authored-by: Yury Selivanov <yury@edgedb.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
3 years agogh-93118: [Enum] fix error message (GH-93138)
Ethan Furman [Mon, 23 May 2022 18:21:58 +0000 (11:21 -0700)] 
gh-93118: [Enum] fix error message (GH-93138)

Include member names in error message.

3 years agogh-83245: Raise BadZipFile instead of ValueError when reading a corrupt ZIP file...
Sam Ezeh [Mon, 23 May 2022 17:59:21 +0000 (18:59 +0100)] 
gh-83245: Raise BadZipFile instead of ValueError when reading a corrupt ZIP file (GH-32291)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
3 years agogh-92913: Fix typos in documentation (GH-93129)
Steve Dower [Mon, 23 May 2022 16:39:10 +0000 (17:39 +0100)] 
gh-92913: Fix typos in documentation (GH-93129)