]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agogh-98393: os module reject bytes-like, only accept bytes (#98394)
Victor Stinner [Tue, 18 Oct 2022 15:52:31 +0000 (17:52 +0200)] 
gh-98393: os module reject bytes-like, only accept bytes (#98394)

The os module and the PyUnicode_FSDecoder() function no longer accept
bytes-like paths, like bytearray and memoryview types: only the exact
bytes type is accepted for bytes strings.

3 years agogh-98331: Update bundled pip to 22.3 (#98332)
Paul Moore [Tue, 18 Oct 2022 14:48:14 +0000 (15:48 +0100)] 
gh-98331: Update bundled pip to 22.3 (#98332)

3 years agoDoc: Found some remaining default roles. (GH-98392)
Julien Palard [Tue, 18 Oct 2022 13:46:18 +0000 (15:46 +0200)] 
Doc: Found some remaining default roles. (GH-98392)

3 years agogh-98378: Add small format string example to strftime comments (GH-98379)
Alex Zvorygin [Tue, 18 Oct 2022 13:42:10 +0000 (06:42 -0700)] 
gh-98378: Add small format string example to strftime comments (GH-98379)

A small example of what a full date and time would look like would help a lot of developers who may not realize that they should investigate `time.h`'s `strftime`, run `man strftime`, or click through a series of docs on the python docs before they get to the actual [definition here](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes) which still doesn't have an obvious copy-pastable example of "what the heck format does this thing actually expect?".

Automerge-Triggered-By: GH:rhettinger
3 years agoDoc: missing underscore in hyperlink. (GH-98391)
Julien Palard [Tue, 18 Oct 2022 13:28:19 +0000 (15:28 +0200)] 
Doc: missing underscore in hyperlink. (GH-98391)

3 years agogh-95913: Copyedit, xref and organize enum section (#98295)
C.A.M. Gerlach [Tue, 18 Oct 2022 09:26:24 +0000 (04:26 -0500)] 
gh-95913: Copyedit, xref and organize enum section (#98295)

* Whatsnew: Convert literals in enum section to actual x-references

* Whatsnew: Rewrite enum section for clear and consistant phrasing

* Whatsnew: Combine directly related enum items instead of seperating them

* gh-98250: Describe __str__/__format__ changes more clearly/accurately

* Tweak enum section language per feedback from Ethan

3 years agogh-95913: Prepare remaining Whatsnew sections for editing (#98342)
C.A.M. Gerlach [Tue, 18 Oct 2022 08:41:57 +0000 (03:41 -0500)] 
gh-95913: Prepare remaining Whatsnew sections for editing (#98342)

* Add line breaks & ref targets to Whatsnew to prepare for future changes

* Use standard heading underbar symbols for H4 sections

* Flatten Porting subsection; clarify scope of/link Python->CAPI sections

* Move C API pending deprecations to C API section, to match the others

3 years agoFix typos in comments (GH-98375)
Raymond Hettinger [Tue, 18 Oct 2022 02:01:28 +0000 (21:01 -0500)] 
Fix typos in comments (GH-98375)

3 years agoGH-98363: Add itertools.batched() (GH-98364)
Raymond Hettinger [Mon, 17 Oct 2022 23:53:45 +0000 (18:53 -0500)] 
GH-98363:  Add itertools.batched() (GH-98364)

3 years agoMove random selection recipes from itertools.rst to random.rst (GH-98369)
Raymond Hettinger [Mon, 17 Oct 2022 22:30:49 +0000 (17:30 -0500)] 
Move random selection recipes from itertools.rst to random.rst (GH-98369)

3 years agogh-95913: Move subinterpreter exper removal to 3.11 WhatsNew (GH-98345)
C.A.M. Gerlach [Mon, 17 Oct 2022 19:59:22 +0000 (14:59 -0500)] 
gh-95913: Move subinterpreter exper removal to 3.11 WhatsNew (GH-98345)

Part of #95913
Forward port of #93306, which was a backport of #93185, to address #84694

This adds the What's New entry for the removal of the subinterpreter-related env variable, build-time flag, etc. As @ericsnowcurrently  was author of the original changes, I added him as a co-author to the commit.

This addition to the Python 3.11 What's New document were only made to the Python 3.11 branch during the backport process, and not added to the version in `main`. Forward-porting it ensures the docs retain these additions for the future, rather than being lost in a legacy Python versions, allows it to be be edited as part of #95913 , and avoids merge conflicts with routine back-ports of PRs touching it.

I've pulled in the addition exactly as-is with no modifications; any editing will be done in future PRs (and therefore can be reviewed and backported accordingly).

The one other such addition is forward-ported in #98344

3 years agogh-95914: Add What's New item describing PEP 670 changes (#98315)
C.A.M. Gerlach [Mon, 17 Oct 2022 19:16:37 +0000 (14:16 -0500)] 
gh-95914: Add What's New item describing PEP 670 changes (#98315)

3 years agoRemove unused arrange_output_buffer function from zlibmodule.c. (GH-98358)
Benjamin Peterson [Mon, 17 Oct 2022 16:38:34 +0000 (09:38 -0700)] 
Remove unused arrange_output_buffer function from zlibmodule.c. (GH-98358)

3 years agogh-98174: Handle EPROTOTYPE under macOS in test_sendfile_fallback_close_peer_in_the_m...
fancidev [Mon, 17 Oct 2022 15:45:38 +0000 (23:45 +0800)] 
gh-98174: Handle EPROTOTYPE under macOS in test_sendfile_fallback_close_peer_in_the_middle_of_receiving (#98316)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
3 years agoGH-98327: Reduce scope of catch_warnings() in _make_subprocess_transport (#98333)
Kumar Aditya [Mon, 17 Oct 2022 15:27:02 +0000 (20:57 +0530)] 
GH-98327: Reduce scope of catch_warnings() in _make_subprocess_transport (#98333)

Alas, warnings.catch_warnings() has global scope, not thread scope, so this is still not perfect, but it reduces the time during which warnings are ignored. Better solution welcome.

3 years agogh-93691: Compiler's code-gen passes location around instead of holding it on the...
Irit Katriel [Mon, 17 Oct 2022 13:28:51 +0000 (14:28 +0100)] 
gh-93691: Compiler's code-gen passes location around instead of holding it on the global compiler state (GH-98001)

3 years agogh-97669: Create Tools/build/ directory (#97963)
Victor Stinner [Mon, 17 Oct 2022 10:01:00 +0000 (12:01 +0200)] 
gh-97669: Create Tools/build/ directory (#97963)

Create Tools/build/ directory. Move the following scripts from
Tools/scripts/ to Tools/build/:

* check_extension_modules.py
* deepfreeze.py
* freeze_modules.py
* generate_global_objects.py
* generate_levenshtein_examples.py
* generate_opcode_h.py
* generate_re_casefix.py
* generate_sre_constants.py
* generate_stdlib_module_names.py
* generate_token.py
* parse_html5_entities.py
* smelly.py
* stable_abi.py
* umarshal.py
* update_file.py
* verify_ensurepip_wheels.py

Update references to these scripts.

3 years agogh-95534: Improve gzip reading speed by 10% (#97664)
Ruben Vorderman [Mon, 17 Oct 2022 02:10:58 +0000 (04:10 +0200)] 
gh-95534: Improve gzip reading speed by 10% (#97664)

Change summary:
+ There is now a `gzip.READ_BUFFER_SIZE` constant that is 128KB. Other programs that read in 128KB chunks: pigz and cat. So this seems best practice among good programs. Also it is faster than 8 kb chunks.
+ a zlib._ZlibDecompressor was added. This is the _bz2.BZ2Decompressor ported to zlib. Since the zlib.Decompress object is better for in-memory decompression, the _ZlibDecompressor is hidden. It only makes sense in file decompression, and that is already implemented now in the gzip library. No need to bother the users with this.
+ The ZlibDecompressor uses the older Cpython arrange_output_buffer functions, as those are faster and more appropriate for the use case.
+ GzipFile.read has been optimized. There is no longer a `unconsumed_tail` member to write back to padded file. This is instead handled by the ZlibDecompressor itself, which has an internal buffer. `_add_read_data` has been inlined, as it was just two calls.

EDIT: While I am adding improvements anyway, I figured I could add another one-liner optimization now to the python -m gzip application. That read chunks in io.DEFAULT_BUFFER_SIZE previously, but has been updated now to use READ_BUFFER_SIZE chunks.

3 years agogh-95913: Forward-port int/str security change to 3.11 What's New in main (#98344)
C.A.M. Gerlach [Mon, 17 Oct 2022 01:43:13 +0000 (20:43 -0500)] 
gh-95913: Forward-port int/str security change to 3.11 What's New in main (#98344)

Add int/str security change from issue gh-95778 PRs gh-96499 / gh-95800

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
3 years agoGH-91415: Mention alphabetical sort ordering in the Sorting HOWTO (GH-98336)
Raymond Hettinger [Sun, 16 Oct 2022 19:34:25 +0000 (14:34 -0500)] 
GH-91415: Mention alphabetical sort ordering in the Sorting HOWTO (GH-98336)

3 years agogh-97930: Merge with importlib_resources 5.9 (GH-97929)
Jason R. Coombs [Sun, 16 Oct 2022 19:00:39 +0000 (15:00 -0400)] 
gh-97930: Merge with importlib_resources 5.9 (GH-97929)

* Merge with importlib_resources 5.9

* Update changelog

3 years agogh-85525: Remove extra row in doc (#98337)
Joannah Nanjekye [Sun, 16 Oct 2022 17:43:31 +0000 (13:43 -0400)] 
gh-85525: Remove extra row in doc (#98337)

* remove extra row

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 years agogh-85299: Add note warning about entry point guard for asyncio example (#93457)
Stanley [Sun, 16 Oct 2022 17:04:43 +0000 (10:04 -0700)] 
gh-85299: Add note warning about entry point guard for asyncio example (#93457)

3 years agogh-97527: IDLE - fix buggy macosx patch (#98313)
Terry Jan Reedy [Sun, 16 Oct 2022 14:23:11 +0000 (10:23 -0400)] 
gh-97527: IDLE - fix buggy macosx patch (#98313)

#97530 fixed IDLE tests possibly crashing on a Mac without a GUI.
But it resulted in IDLE not starting in 3.10.8, 3.12.0a1, and
Microsoft Python 3.10.2288.0 when test/* is not installed.
After this patch, test.* is only imported when testing on Mac.

3 years agogh-98307: Add docstring and documentation for SysLogHandler.createSocket (GH-98319)
Vinay Sajip [Sun, 16 Oct 2022 08:15:46 +0000 (09:15 +0100)] 
gh-98307: Add docstring and documentation for SysLogHandler.createSocket (GH-98319)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agogh-94808: Cover `PyFunction_GetCode`, `PyFunction_GetGlobals`, `PyFunction_GetModule...
Nikita Sobolev [Sun, 16 Oct 2022 04:18:59 +0000 (07:18 +0300)] 
gh-94808: Cover `PyFunction_GetCode`, `PyFunction_GetGlobals`, `PyFunction_GetModule` (#98158)

3 years agoGH-94597: Deprecate child watcher getters and setters (#98215)
Kumar Aditya [Sat, 15 Oct 2022 23:09:30 +0000 (04:39 +0530)] 
GH-94597: Deprecate child watcher getters and setters (#98215)

This is the next step for deprecating child watchers.

Until we've removed the API completely we have to use it, so this PR is mostly suppressing a lot of warnings when using the API internally.

Once the child watcher API is totally removed, the two child watcher implementations we actually use and need (Pidfd and Thread) will be turned into internal helpers.

3 years agogh-98254: Include stdlib module names in error messages for NameErrors (#98255)
Pablo Galindo Salgado [Sat, 15 Oct 2022 22:13:33 +0000 (23:13 +0100)] 
gh-98254: Include stdlib module names in error messages for NameErrors (#98255)

3 years agoImprove speed. Reduce auxiliary memory to 16.6% of the main array. (GH-98294)
Raymond Hettinger [Sat, 15 Oct 2022 21:05:28 +0000 (16:05 -0500)] 
Improve speed. Reduce auxiliary memory to 16.6% of the main array. (GH-98294)

3 years ago[doc] Update logging cookbook with an example of custom handling of levels. (GH-98290)
Vinay Sajip [Sat, 15 Oct 2022 20:23:06 +0000 (21:23 +0100)] 
[doc] Update logging cookbook with an example of custom handling of levels. (GH-98290)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agodocs(typing): harmonize "See PEP x for more details" (#97927)
Simon Legner [Sat, 15 Oct 2022 19:17:51 +0000 (21:17 +0200)] 
docs(typing): harmonize "See PEP x for more details" (#97927)

3 years agogh-94808: Cover `str.rsplit` for UCS1, UCS2 or UCS4 (#98228)
Nikita Sobolev [Sat, 15 Oct 2022 18:40:22 +0000 (21:40 +0300)] 
gh-94808: Cover `str.rsplit` for UCS1, UCS2 or UCS4 (#98228)

3 years agoFaster sieve() recipe (#98287)
Raymond Hettinger [Sat, 15 Oct 2022 17:43:58 +0000 (12:43 -0500)] 
Faster sieve() recipe (#98287)

3 years agogh-98227: executionmodel.rst: except* can also bind names (#98256)
BiscuitCandy [Sat, 15 Oct 2022 16:04:08 +0000 (21:34 +0530)] 
gh-98227: executionmodel.rst: except* can also bind names (#98256)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-94808: Cover `PyEval_GetFuncName` (#98246)
Nikita Sobolev [Sat, 15 Oct 2022 15:20:39 +0000 (18:20 +0300)] 
gh-94808: Cover `PyEval_GetFuncName` (#98246)

3 years agogh-95731: Fix module docstring extraction in pygettext (#95732)
Jakub Kuczys [Sat, 15 Oct 2022 14:57:53 +0000 (16:57 +0200)] 
gh-95731: Fix module docstring extraction in pygettext (#95732)

3 years agogh-95971: Turn @writes_bytecode_files to skip when not running (#95972)
Jeong YunWon [Sat, 15 Oct 2022 14:57:06 +0000 (23:57 +0900)] 
gh-95971: Turn @writes_bytecode_files to skip when not running (#95972)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-96258: move Py_REFCNT and Py_SET_REFCNT to reference counting page (#96259)
QuakeIV [Sat, 15 Oct 2022 14:56:14 +0000 (07:56 -0700)] 
gh-96258: move Py_REFCNT and Py_SET_REFCNT to reference counting page (#96259)

3 years agogh-85455: Add missing doc strings and improve docs (#21573)
Joannah Nanjekye [Sat, 15 Oct 2022 13:31:06 +0000 (09:31 -0400)] 
gh-85455: Add missing doc strings and improve docs (#21573)

* Add missing doc strings and improve docs

* Use imperative form

* Modify docstring wording

3 years agogh-85525: Indicate supported sound header formats (#21575)
Joannah Nanjekye [Sat, 15 Oct 2022 13:30:05 +0000 (09:30 -0400)] 
gh-85525: Indicate supported sound header formats (#21575)

* Indicate supported sound header formats

* modify file names

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-91485: Doc: Using Python syntax to document builtin Python functions. (GH-96579)
Julien Palard [Sat, 15 Oct 2022 10:19:35 +0000 (12:19 +0200)] 
gh-91485: Doc: Using Python syntax to document builtin Python functions. (GH-96579)

3 years agogh-98251: Allow venv to pass along PYTHON* variables to pip and ensurepip when they...
Steve Dower [Fri, 14 Oct 2022 15:58:54 +0000 (16:58 +0100)] 
gh-98251: Allow venv to pass along PYTHON* variables to pip and ensurepip when they do not impact path resolution (GH-98259)

3 years agoBpo-41246: IOCP Proactor avoid callback code duplication (#21399) 98272/head
Tony Solomonik [Thu, 13 Oct 2022 18:05:16 +0000 (21:05 +0300)] 
Bpo-41246: IOCP Proactor avoid callback code duplication (#21399)

Use the same callback function for overlapped operations recv, recv_into, recvfrom, sendto, send, and sendfile inside IocpProactor.

3 years agobpo-46364: Use sockets for stdin of asyncio only on AIX (#30596)
Christoph Hamsen [Thu, 13 Oct 2022 16:11:15 +0000 (18:11 +0200)] 
bpo-46364: Use sockets for stdin of asyncio only on AIX (#30596)

Signed-off-by: Christoph Hamsen <hamsen.christoph@posteo.de>
Co-authored-by: July Tikhonov <july.tikh@gmail.com>
3 years agogh-98178: syslog() is not thread-safe on macOS (#98213)
Victor Stinner [Thu, 13 Oct 2022 11:34:55 +0000 (13:34 +0200)] 
gh-98178: syslog() is not thread-safe on macOS (#98213)

On macOS, fix a crash in syslog.syslog() in multi-threaded
applications. On macOS, the libc syslog() function is not
thread-safe, so syslog.syslog() no longer releases the GIL to call
it.

3 years agoMark all targets in `Doc/Makefile` as `PHONY` (GH-98189)
Nikita Sobolev [Wed, 12 Oct 2022 19:40:47 +0000 (22:40 +0300)] 
Mark all targets in `Doc/Makefile` as `PHONY` (GH-98189)

3 years agogh-97982: Factorize PyUnicode_Count() and unicode_count() code (#98025)
Nikita Sobolev [Wed, 12 Oct 2022 16:27:53 +0000 (19:27 +0300)] 
gh-97982: Factorize PyUnicode_Count() and unicode_count() code (#98025)

Add unicode_count_impl() to factorize PyUnicode_Count()
and unicode_count() code.

3 years agogh-96265: Formatting changes for faq/general (#98129)
Stanley [Wed, 12 Oct 2022 16:04:41 +0000 (09:04 -0700)] 
gh-96265: Formatting changes for faq/general (#98129)

* Some formatting changes for general faq

* Use list for Python versioning

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* New line for list, list for a/b/rc

* Line wrap for 80 chars

* More line wrap

* Remove PythonWin mention.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agotutorial: remove "with single quotes" (#98204)
Jelle Zijlstra [Wed, 12 Oct 2022 16:00:51 +0000 (09:00 -0700)] 
tutorial: remove "with single quotes" (#98204)

Closes #91856.

On Windows double quotes are sometimes better, on Unix usually
single quotes. It's not our place to explain that, so just don't.

3 years agogh-97669: Remove Tools/scripts/startuptime.py (#98214)
Victor Stinner [Wed, 12 Oct 2022 15:53:46 +0000 (17:53 +0200)] 
gh-97669: Remove Tools/scripts/startuptime.py (#98214)

The "pyperf command" tool be used instead. Example:

    $ python3 -m pyperf command -- python3 -c pass
    .....................
    command: Mean +- std dev: 17.8 ms +- 0.4 ms

pyperf also computes the standard deviation which gives an idea of
the benchmark looks reliable or not.

3 years agosignalmodule.c uses _PyErr_WriteUnraisableMsg() (#98217)
Victor Stinner [Wed, 12 Oct 2022 15:26:58 +0000 (17:26 +0200)] 
signalmodule.c uses _PyErr_WriteUnraisableMsg() (#98217)

Signal wakeup fd errors are now logged with
_PyErr_WriteUnraisableMsg(), rather than PySys_WriteStderr() and
PyErr_WriteUnraisable(), to pass the error message to
sys.unraisablehook. By default, it's still written into stderr (unless
sys.unraisablehook is overriden).

3 years agogh-97669: Fix test_tools reference leak (#98216)
Victor Stinner [Wed, 12 Oct 2022 15:26:21 +0000 (17:26 +0200)] 
gh-97669: Fix test_tools reference leak (#98216)

test_tools.test_sundry() now uses an unittest mock to prevent the
logging module to register a real "atfork" function which kept the
logging module dictionary alive. So the logging module can be
properly unloaded. Previously, the logging module was loaded before
test_sundry(), but it's no longer the case since recent test_tools
sub-tests removals.

3 years agogh-97669: Create Tools/patchcheck/ directory (#98186)
Victor Stinner [Wed, 12 Oct 2022 08:09:21 +0000 (10:09 +0200)] 
gh-97669: Create Tools/patchcheck/ directory (#98186)

Move patchcheck.py, reindent.py and untabify.py scripts to a new
Tools/patchcheck/ directory.

3 years agogh-65046: Link to logging cookbook from asyncio docs (#98207)
Shantanu [Wed, 12 Oct 2022 04:42:57 +0000 (21:42 -0700)] 
gh-65046: Link to logging cookbook from asyncio docs (#98207)

3 years agoFormatting fixes in contextlib docs (#98111)
Stanley [Wed, 12 Oct 2022 03:56:32 +0000 (20:56 -0700)] 
Formatting fixes in contextlib docs (#98111)

3 years agogh-95276: Add callable entry to the glossary (#95738)
MonadChains [Wed, 12 Oct 2022 02:41:08 +0000 (04:41 +0200)] 
gh-95276: Add callable entry to the glossary (#95738)

3 years agogh-96130: Rephrase use of "typecheck" verb for clarity (#98144)
Shantanu [Wed, 12 Oct 2022 02:37:58 +0000 (19:37 -0700)] 
gh-96130: Rephrase use of "typecheck" verb for clarity (#98144)

I'm sympathetic to the issue report, especially in case this helps
clarify to new users that Python itself does not do type checking at runtime

3 years agoFix some incorrect indentation around the main switch (#98177)
Guido van Rossum [Tue, 11 Oct 2022 23:45:53 +0000 (16:45 -0700)] 
Fix some incorrect indentation around the main switch (#98177)

The `}` marked with `/* End instructions */` is the end of the switch.
There is another pair of `{}` around the switch, which is vestigial
from ancient times when it was `for (;;) { switch (opcode) { ... } }`.
All `DISPATCH` macro calls should be inside that pair.

3 years agogh-98172: Fix formatting in `except*` docs (#98173)
Jelle Zijlstra [Tue, 11 Oct 2022 16:13:56 +0000 (09:13 -0700)] 
gh-98172: Fix formatting in `except*` docs (#98173)

3 years agogh-97982: Remove asciilib_count() (#98164)
Victor Stinner [Tue, 11 Oct 2022 15:59:58 +0000 (17:59 +0200)] 
gh-97982: Remove asciilib_count() (#98164)

asciilib_count() is the same than ucs1lib_count(): the code is not
specialized for ASCII strings, so it's not worth it to have a
separated function. Remove asciilib_count() function.

3 years agogh-95756: Free and NULL-out code caches when needed (GH-98181)
Ken Jin [Tue, 11 Oct 2022 15:11:46 +0000 (23:11 +0800)] 
gh-95756: Free and NULL-out code caches when needed (GH-98181)

3 years agogh-86404: Doc: Drop now unused make suspicious and rstlint. (GH-98179)
Julien Palard [Tue, 11 Oct 2022 13:31:33 +0000 (15:31 +0200)] 
gh-86404: Doc: Drop now unused make suspicious and rstlint. (GH-98179)

They have been replaced by
[sphinx-lint](https://github.com/sphinx-contrib/sphinx-lint).

3 years agoUpgrade ccache-action to one using Node 16 (#98166)
Michael Droettboom [Tue, 11 Oct 2022 13:15:14 +0000 (09:15 -0400)] 
Upgrade ccache-action to one using Node 16 (#98166)

Github Actions has deprecated the use of Node 12, and will be turning it off by
summer 2023.

https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

3 years agogh-97669: Remove abitype.py and pep384_macrocheck.py (#98165)
Victor Stinner [Tue, 11 Oct 2022 11:18:53 +0000 (13:18 +0200)] 
gh-97669: Remove abitype.py and pep384_macrocheck.py (#98165)

Remove abitype.py and pep384_macrocheck.py scripts of Tools/scripts/.

3 years agogh-71616: Add note to warn against general translation of saxutils.escape() (#93450)
Stanley [Tue, 11 Oct 2022 09:27:49 +0000 (02:27 -0700)] 
gh-71616: Add note to warn against general translation of saxutils.escape() (#93450)

* Add note to warn against general translation of saxutils.escape()

* Use more direct wording

3 years agogh-97669: Remove outdated example scripts (#97675) (#98167)
Victor Stinner [Tue, 11 Oct 2022 08:07:57 +0000 (10:07 +0200)] 
gh-97669: Remove outdated example scripts (#97675) (#98167)

Remove outdated example scripts of the Tools/scripts/ directory:

* gprof2html.py
* md5sum.py
* nm2def.py
* pathfix.py
* win_add2path.py

Remove test_gprof2html, test_md5sum and test_pathfix of test_tools.

3 years agogh-95756: Lazily created cached co_* attrs (GH-97791)
Ken Jin [Tue, 11 Oct 2022 03:26:08 +0000 (20:26 -0700)] 
gh-95756: Lazily created cached co_* attrs (GH-97791)

3 years agogh-44098: Release the GIL during mmap on Unix (GH-98146)
Shantanu [Mon, 10 Oct 2022 22:14:31 +0000 (15:14 -0700)] 
gh-44098: Release the GIL during mmap on Unix (GH-98146)

This seems pretty straightforward. The issue mentions other calls in mmapmodule that we could release the GIL on, but those are in methods where we'd need to be careful to ensure that something sensible happens if those are called concurrently. In prior art, note that #12073 released the GIL for munmap.  In a toy benchmark, I see the speedup you'd expect from doing this.

Automerge-Triggered-By: GH:gvanrossum
3 years agogh-88452: Add a warning about non-portability of environments. (GH-98155)
Vinay Sajip [Mon, 10 Oct 2022 18:27:52 +0000 (19:27 +0100)] 
gh-88452: Add a warning about non-portability of environments. (GH-98155)

3 years agogh-96821: Fix undefined behaviour in `audioop.c` (#96923)
Matthias Görgens [Mon, 10 Oct 2022 16:12:29 +0000 (00:12 +0800)] 
gh-96821: Fix undefined behaviour in `audioop.c` (#96923)

* gh-96821: Fix undefined behaviour in `audioop.c`

Left-shifting negative numbers is undefined behaviour.

Fortunately, multiplication works just as well, is defined behaviour,
and gets compiled to the same machine code as before by optimizing
compilers.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 years agogh-94808: Add coverage for bytesarray_setitem (#95802)
Michael Droettboom [Mon, 10 Oct 2022 15:28:41 +0000 (11:28 -0400)] 
gh-94808: Add coverage for bytesarray_setitem (#95802)

3 years agogh-83940: os docs: Improve wording for getenv/getenvb (#98113)
Stanley [Mon, 10 Oct 2022 13:43:01 +0000 (06:43 -0700)] 
gh-83940: os docs: Improve wording for getenv/getenvb (#98113)

3 years agodoc: remove a misleading statement. (GH-98093)
Julien Palard [Mon, 10 Oct 2022 07:01:16 +0000 (09:01 +0200)] 
doc: remove a misleading statement. (GH-98093)

3 years agobpo-43564: preserve original exception in args of FTP URLError (#24938)
Carl Meyer [Mon, 10 Oct 2022 01:59:07 +0000 (03:59 +0200)] 
bpo-43564: preserve original exception in args of FTP URLError (#24938)

* bpo-43564: preserve original error in args of FTP URLError

* Add NEWS blurb

Co-authored-by: Carl Meyer <carljm@instagram.com>
3 years agogh-98083: Fix URLs in `README.rst` (#98082)
Tiger [Mon, 10 Oct 2022 01:31:53 +0000 (20:31 -0500)] 
gh-98083: Fix URLs in `README.rst` (#98082)

3 years agoFix types in buffer/memoryview docs (#98118)
da-woods [Mon, 10 Oct 2022 00:55:53 +0000 (01:55 +0100)] 
Fix types in buffer/memoryview docs (#98118)

The definition of obj in the `Py_buffer` struct is as a PyObject*
https://github.com/python/cpython/blob/ec091bd47e2f968b0d1631b9a8104283a7beeb1b/Include/pybuffer.h#L22

PyMemoryView_GET_BASE returns `.obj` - thus its return type
should be a PyObject* (or at least a void*). It definitely
doesn't return `Py_buffer`

3 years agogh-56133: copyreg docs: Clarify function/constructor parameter (#95497)
Stanley [Mon, 10 Oct 2022 00:51:02 +0000 (17:51 -0700)] 
gh-56133: copyreg docs: Clarify function/constructor parameter (#95497)

3 years agoUpdate whatsnew instructions for GitHub (#98124)
Carl Meyer [Sun, 9 Oct 2022 22:29:25 +0000 (00:29 +0200)] 
Update whatsnew instructions for GitHub (#98124)

3 years agogh-97841: Add methoddef for _filters_mutated (gh-98115)
Dong-hee Na [Sun, 9 Oct 2022 11:16:33 +0000 (20:16 +0900)] 
gh-97841: Add methoddef for _filters_mutated (gh-98115)

3 years agoMinor edits to the Descriptor HowTo Guide (GH-24901)
Géry Ogam [Sun, 9 Oct 2022 01:54:21 +0000 (03:54 +0200)] 
Minor edits to the Descriptor HowTo Guide (GH-24901)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
3 years agoFix link to Lifecycle of a Pull Request in CONTRIBUTING (#98102)
Jacob Walls [Sat, 8 Oct 2022 22:16:52 +0000 (18:16 -0400)] 
Fix link to Lifecycle of a Pull Request in CONTRIBUTING (#98102)

* Fix link to Lifecycle of a Pull Request in CONTRIBUTING

* Remove trailing backslash.

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agoGH-94597: deprecate `SafeChildWatcher`, `FastChildWatcher` and `MultiLoopChildWatcher...
Kumar Aditya [Sat, 8 Oct 2022 20:52:19 +0000 (02:22 +0530)] 
GH-94597: deprecate `SafeChildWatcher`, `FastChildWatcher` and `MultiLoopChildWatcher` child watchers  (#98089)

3 years agoAuto-cancel old builds when new commit pushed to branch (#98009)
Hugo van Kemenade [Sat, 8 Oct 2022 19:21:38 +0000 (21:21 +0200)] 
Auto-cancel old builds when new commit pushed to branch (#98009)

* Auto-cancel old builds when new commit pushed to branch

* Add a fallback

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* Use the same group for all workflows.

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agogh-95011: Migrate syslog module to Argument Clinic (GH-95012)
Noam Cohen [Sat, 8 Oct 2022 18:31:57 +0000 (21:31 +0300)] 
gh-95011: Migrate syslog module to Argument Clinic (GH-95012)

3 years agogh-68686: Retire eptag ptag scripts (#98064)
Joannah Nanjekye [Sat, 8 Oct 2022 14:57:47 +0000 (07:57 -0700)] 
gh-68686: Retire eptag ptag scripts (#98064)

* Retire eptag ptag scripts

* 📜🤖 Added by blurb_it.

* fix news entry error

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
3 years agogh-97922: Run the GC only on eval breaker (#97920)
Pablo Galindo Salgado [Sat, 8 Oct 2022 14:57:09 +0000 (07:57 -0700)] 
gh-97922: Run the GC only on eval breaker (#97920)

3 years agoGitHub Workflows security hardening (#96492)
Alex [Sat, 8 Oct 2022 08:13:34 +0000 (11:13 +0300)] 
GitHub Workflows security hardening (#96492)

* Update project-updater.yml

Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
* Update project-updater.yml

repository-projects: write is not needed because a separate secrets.ADD_TO_PROJECT_PAT is used

Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
3 years agoAdd `@ezio-melotti` as codeowner for `.github/`. (#98079)
Ezio Melotti [Sat, 8 Oct 2022 07:11:38 +0000 (09:11 +0200)] 
Add `@ezio-melotti` as codeowner for `.github/`. (#98079)

3 years agogh-97913 Docs: Add walrus operator to the index (#97921)
Hugo van Kemenade [Sat, 8 Oct 2022 06:54:16 +0000 (23:54 -0700)] 
gh-97913 Docs: Add walrus operator to the index (#97921)

* Add walrus operator to the index

* Add named expression to the index

Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
* Fix indentation and add missing newline

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years ago[doc] Fix broken links to C extensions accelerating stdlib modules (#96914)
partev [Sat, 8 Oct 2022 05:55:35 +0000 (01:55 -0400)] 
[doc] Fix broken links to C extensions accelerating stdlib modules (#96914)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
3 years agogh-97822: Fix http.server documentation reference to test() function (#98027)
JasonYZ [Sat, 8 Oct 2022 04:46:23 +0000 (05:46 +0100)] 
gh-97822: Fix http.server documentation reference to test() function (#98027)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-91052: Add PyDict_Unwatch for unwatching a dictionary (#98055)
Carl Meyer [Sat, 8 Oct 2022 00:37:46 +0000 (17:37 -0700)] 
gh-91052: Add PyDict_Unwatch for unwatching a dictionary (#98055)

3 years agoGH-98023: Change default child watcher to PidfdChildWatcher on supported systems...
Kumar Aditya [Sat, 8 Oct 2022 00:29:09 +0000 (05:59 +0530)] 
GH-98023: Change default child watcher to PidfdChildWatcher on supported systems (#98024)

3 years agoGH-94182: Run the PidfdChildWatcher on the running loop (#94184)
Thomas Grainger [Sat, 8 Oct 2022 00:24:01 +0000 (01:24 +0100)] 
GH-94182: Run the PidfdChildWatcher on the running loop (#94184)

There is no reason for this watcher to be attached to any particular loop.
This should make it safe to use regardless of the lifetime of the event loop running in the main thread
(relative to other loops).

Co-authored-by: Yury Selivanov <yury@edgedb.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-92886: make test_ast pass with -O (assertions off) (GH-98058)
Irit Katriel [Fri, 7 Oct 2022 23:30:23 +0000 (00:30 +0100)] 
gh-92886: make test_ast pass with -O (assertions off) (GH-98058)

-O does not strip docstrings.

Automerge-Triggered-By: GH:iritkatriel
3 years agogh-92886: make test_coroutines pass with -O (assertions off) (GH-98060)
Irit Katriel [Fri, 7 Oct 2022 23:12:28 +0000 (00:12 +0100)] 
gh-92886: make test_coroutines pass with -O (assertions off) (GH-98060)

Automerge-Triggered-By: GH:iritkatriel
3 years agogh-57179: Add note on symlinks for os.walk (#94799)
Stanley [Fri, 7 Oct 2022 22:51:50 +0000 (15:51 -0700)] 
gh-57179: Add note on symlinks for os.walk (#94799)

3 years agogh-94808: Fix regex on exotic platforms (#98036)
Jelle Zijlstra [Fri, 7 Oct 2022 22:39:53 +0000 (15:39 -0700)] 
gh-94808: Fix regex on exotic platforms (#98036)

The test failed on a buildbot because the pointer was only 7 hex characters. To be safe,
I bumped it down to 3: 4 in case we have 32-bit platforms, and 3 in case the pointer is very small.

3 years agogh-90085: Remove vestigial -t and -c timeit options (#94941)
Shantanu [Fri, 7 Oct 2022 22:38:20 +0000 (15:38 -0700)] 
gh-90085: Remove vestigial -t and -c timeit options (#94941)

See bpo-28240. The functionality was removed in 3d7feb9ac2.
The options had been deprecated since Python 3.3

3 years agoGH-83901: Improve Signature.bind error message for missing keyword-only params (...
Frazer McLean [Fri, 7 Oct 2022 22:24:17 +0000 (00:24 +0200)] 
GH-83901: Improve Signature.bind error message for missing keyword-only params (#95347)

Fixes GH-83901