Commit Graph

27565 Commits

Author SHA1 Message Date
Victor Stinner dbc8216f4c
gh-104773: PEP 594: Remove the uu module (#104932)
Doc/license.rst: Keep the UUencode and UUdecode license since it's
also used by the uu codec.
2023-05-25 16:25:27 +02:00
Victor Stinner e4127eaa1e
gh-104773: PEP 594: Remove the crypt module (#104908)
Remove the crypt module and its private _crypt extension, deprecated
in Python 3.11.
2023-05-25 15:45:46 +02:00
Zachary Ware 98c4333e88
gh-104773: Remove the msilib package (GH-104911) 2023-05-24 20:06:00 -05:00
Jelle Zijlstra 41768a2bd3
gh-104874: Document NewType.__supertype__ (#104875) 2023-05-25 00:23:28 +01:00
Steve Dower 6031727a37
gh-104820: Fixes os.stat on Windows to better handle file systems that do not support FileIdInformation (GH-104892) 2023-05-25 00:16:13 +01:00
Victor Stinner 087c1a6539
gh-104773: PEP 594: Remove the xdrlib module (#104900)
pickle documentation no longer mentions the XDR format.
2023-05-25 00:40:30 +02:00
Victor Stinner 17e1fe0f9b
gh-104773: PEP 594: Remove the nis module (#104897) 2023-05-25 00:08:36 +02:00
Hugo van Kemenade b1cb30ec86
gh-104835: Remove unittest's deprecated getTestCaseNames, makeSuite, findTestCases (#104836) 2023-05-24 21:16:43 +00:00
Victor Stinner ded5f1f287
gh-104773: PEP 594: Remove the nntplib module (#104894)
* socket_helper.transient_internet() no longer imports nntplib to
  catch nntplib.NNTPTemporaryError.
* ssltests.py no longer runs test_nntplib.
* "make quicktest" no longer runs test_nntplib.
* WASM: remove nntplib from OMIT_NETWORKING_FILES.
* Remove mentions to nntplib in the email documentation.
2023-05-24 21:15:43 +00:00
Victor Stinner 684e99d01d
gh-104773: PEP 594: Remove the spwd module (#104871)
Remove spwd from the configure script and Modules/Setup.
2023-05-24 20:34:41 +00:00
Jonathan Protzenko 160321e530
gh-99108: Refresh HACL* (#104808)
Refresh HACL* from upstream to improve SHA2 performance and fix a 32-bit issue in SHA3.
2023-05-24 13:30:11 -07:00
Jelle Zijlstra fe77a99fc8
gh-104879: Fix TypeAliasType.__module__ in exec() (#104881) 2023-05-24 11:48:13 -07:00
Victor Stinner 9d457e1154
gh-104773: PEP 594: Remove the mailcap module (#104867)
Remove Lib/test/mailcap.txt test file.
2023-05-24 14:16:55 +00:00
Victor Stinner a5e0f5b230
gh-104773: PEP 594: Remove the sunau module (#104863)
* Remove Lib/test/audiodata/pluck-*.au files.
* Remove Lib/test/audiotest.au file.
2023-05-24 13:51:59 +00:00
Victor Stinner fc07fe4e37
gh-104773: PEP 594: Remove the ossaudiodev module (#104862)
* Remove ossaudiodev extension in configure.ac and regenerate
  the configure script.
* Remove ossaudiodev in Modules/Setup and Modules/Setup.stdlib.in.
2023-05-24 15:00:51 +02:00
Victor Stinner a4b7e9d1f8
gh-104773: PEP 594: Remove the pipes module (#104848) 2023-05-24 13:11:29 +02:00
Pablo Galindo Salgado c8cf9b42eb
gh-104825: Remove implicit newline in the line attribute in tokens emitted in the tokenize module (#104846) 2023-05-24 09:59:18 +00:00
Victor Stinner 7b00940f69
gh-104773: PEP 594: Remove the sndhdr module (#104774)
Remove the Lib/test/sndhdrdata/ directory.
2023-05-24 09:32:18 +00:00
Victor Stinner 08d5923896
gh-104773: PEP 594: Remove cgi and cgitb modules (#104775)
* Replace "cgi" with "!cgi" in the Sphinx documentation to avoid
  warnings on broken references.
* test_pyclbr no longer tests the cgi module.
2023-05-24 09:04:53 +00:00
Terry Jan Reedy e561c09975
gh-104719: IDLE - test existence of all tokenize references. (#104767)
Class editor.IndentSearcher contains all editor references to tokenize module.
Module io tokenize reference cover those other modules.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-24 08:43:56 +00:00
Jelle Zijlstra c0ab7d401c
gh-104797: Allow Protocols to inherit from collections.abc.Buffer (#104827) 2023-05-24 08:24:53 +00:00
melanie witt 2e0931046d
gh-85934: Use getattr_static when adding mock spec (#22209)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-05-23 17:10:34 -06:00
Barney Gale 6b1510cf11
GH-83863: Drop support for using `pathlib.Path` objects as context managers (GH-104807)
In Python 3.8 and prior, `pathlib.Path.__exit__()` marked a path as closed;
some subsequent attempts to perform I/O would raise an IOError. This
functionality was never documented, and had the effect of making `Path`
objects mutable, contrary to PEP 428. In Python 3.9 we made `__exit__()` a
no-op, and in 3.11 `__enter__()` began raising deprecation warnings. Here
we remove both methods.
2023-05-23 22:31:59 +00:00
Nicolas Tessore d56c933992
gh-104770: Let generator.close() return value (#104771)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-05-23 13:51:56 -07:00
Robert O'Shea 50fce89d12
gh-102120: [TarFile] Add an iter function that doesn't cache (GH-102128) 2023-05-23 13:44:40 -07:00
Ned Deily 08b4eb83aa
Remove gh-103207 changelog item as it was never part of any release. (GH-104814) 2023-05-23 16:03:13 -04:00
Victor Stinner ae00b810d1
gh-104780: Remove 2to3 program and lib2to3 module (#104781)
* Remove the Tools/scripts/2to3 script.
* Remove the Lib/test/test_lib2to3/ directory.
* Doc/tools/extensions/pyspecific.py: remove the "2to3fixer" object
  type.
* Makefile and PC/layout/main.py no longer compile lib2to3 grammar
  files.
* Update Makefile for 2to3 removal.
2023-05-23 19:40:02 +02:00
Daniel Fortunov ddb1485953
gh-81005: Refactor str tests to reflect that str and unicode are merged in Python 3 (#13172)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-05-23 17:11:29 +03:00
Sebastian Rittau abdda5b133
gh-92871: Remove typing.{io,re} namespaces (#92873)
Closes #92871

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-23 13:44:26 +00:00
Victor Stinner 9dc476be2d
gh-104773: PEP 594: Remove the telnetlib module (#104778) 2023-05-23 07:09:02 +00:00
Gregory P. Smith 2e5d8a90aa
gh-99108: Release the GIL around hashlib built-in computation (#104675)
This matches the GIL releasing behavior of our existing `_hashopenssl`
module, extending it to the HACL* built-ins.

Includes adding comments to better describe the ENTER/LEAVE macros
purpose and explain the lock strategy in both existing and new code.
2023-05-23 00:06:41 +00:00
Brandt Bucher 357bed0bcd
GH-104668: Don't call PyOS_* hooks in subinterpreters (GH-104674) 2023-05-22 19:34:34 +00:00
Thomas Wouters 5612078f68 Python 3.12.0b1 2023-05-22 14:07:36 +02:00
Gregory Szorc 5360cb3d56
gh-101282: Apply BOLT optimizations to libpython for shared builds (#104709)
Apply BOLT optimizations to libpython for shared builds. Most of the C
code is in libpython so it is critical to apply BOLT there fully realize
BOLT benefits.

This change also reworks how BOLT instrumentation is applied. It
effectively removes the readelf based logic added in gh-101525 and
replaces it with a mechanism that saves a copy of the pre-bolt binary
and restores that copy when necessary. This allows us to perform BOLT
optimizations without having to manually delete the output binary to
force a new bolt run.

Also:
- add a clean-bolt target for purging BOLT files and hook that up to the
  clean target
- .gitignore BOLT related files

Before and after this refactor, `make` will no-op after a previous run.
Both versions should also share common make DAG deficiencies where
targets fail to trigger as often as they need to or can trigger
prematurely in certain scenarios. e.g. after this change you may need to
`rm profile-bolt-stamp` to force a BOLT run because there aren't
appropriate non-phony targets for BOLT's make target to depend on.

To make it easier to iterate on custom BOLT settings, the flags to pass
to instrumentation and application are now defined in configure and can
be overridden by passing BOLT_INSTRUMENT_FLAGS and BOLT_APPLY_FLAGS.
2023-05-22 13:45:20 +02:00
Serhiy Storchaka 9bc80dac47
gh-94473: Flatten arguments in tkinter.Canvas.coords() (GH-98479)
It now accepts not only "x1, y1, x2, y2, ..." and "[x1, y1, x2, y2, ...]",
but also "(x1, y1), (x2, y2), ..." and "[(x1, y1), (x2, y2), ...]".
2023-05-22 11:54:41 +03:00
Ned Deily 13e460086b
gh-99834: Update macOS installer to Tcl/Tk 8.6.13. (GH-104738) 2023-05-22 06:33:50 +00:00
Jelle Zijlstra a5f244d627
gh-104656: Rename typeparams AST node to type_params (#104657) 2023-05-21 21:25:09 -07:00
Luccccifer ef5d00a592
gh-104536: Improve `multiprocessing.process._cleanup` logic (#104537)
Fix a race condition in the internal `multiprocessing.process` cleanup
logic that could manifest as an unintended `AttributeError` when calling
`BaseProcess.close()`.

---------

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-05-22 03:48:57 +00:00
Serhiy Storchaka f3466bc040
gh-98836: Extend PyUnicode_FromFormat() (GH-98838)
* Support for conversion specifiers o (octal) and X (uppercase hexadecimal).
* Support for length modifiers j (intmax_t) and t (ptrdiff_t).
* Length modifiers are now applied to all integer conversions.
* Support for wchar_t C strings (%ls and %lV).
* Support for variable width and precision (*).
* Support for flag - (left alignment).
2023-05-22 00:32:39 +03:00
Mark Shannon 93923793f6
GH-101291: Add low level, unstable API for pylong (GH-101685)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2023-05-21 14:45:48 +01:00
gsallam be0c106789
gh-103295: expose API for writing perf map files (#103546)
Co-authored-by: Aniket Panse <aniketpanse@fb.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-05-21 11:12:24 +01:00
Marta Gómez Macías 6715f91edc
gh-102856: Python tokenizer implementation for PEP 701 (#104323)
This commit replaces the Python implementation of the tokenize module with an implementation
that reuses the real C tokenizer via a private extension module. The tokenize module now implements
a compatibility layer that transforms tokens from the C tokenizer into Python tokenize tokens for backward
compatibility.

As the C tokenizer does not emit some tokens that the Python tokenizer provides (such as comments and non-semantic newlines), a new special mode has been added to the C tokenizer mode that currently is only used via
the extension module that exposes it to the Python layer. This new mode forces the C tokenizer to emit these new extra tokens and add the appropriate metadata that is needed to match the old Python implementation.

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2023-05-21 01:03:02 +01:00
Christian Heimes 3ed57e4995
gh-61460: Stronger HMAC in multiprocessing (#20380)
bpo-17258:  `multiprocessing` now supports stronger HMAC algorithms for inter-process connection authentication rather than only HMAC-MD5.

Signed-off-by: Christian Heimes <christian@python.org>

gpshead: I Reworked to be more robust while keeping the idea.

The protocol modification idea remains, but we now take advantage of the
message length as an indicator of legacy vs modern protocol version.  No
more regular expression usage.  We now default to HMAC-SHA256, but do so
in a way that will be compatible when communicating with older clients
or older servers. No protocol transition period is needed.

More integration tests to verify these claims remain true are required. I'm
unaware of anyone depending on multiprocessing connections between
different Python versions.

---------

Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
2023-05-20 23:33:09 +00:00
Prince Roshan ceaa4c3476
gh-103987: fix several crashes in mmap module (#103990)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-19 20:34:12 -07:00
Matthias Görgens 6e39fa1955
gh-94906: Support multiple steps in math.nextafter (#103881)
This PR updates `math.nextafter` to add a new `steps` argument. The behaviour is as though `math.nextafter` had been called `steps` times in succession.

---------

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2023-05-19 21:03:49 +01:00
Christopher Chavez 625887e6df
gh-103839: Allow building Tkinter against Tcl 8.7 without external libtommath (GH-103842) 2023-05-19 15:09:59 -04:00
Soumendra Ganguly 486bc8e030
gh-85984: New additions and improvements to the tty library. (#101832)
New additions to the tty library. Functions added: cfmakeraw(), and cfmakecbreak(). The
functions setcbreak() and setraw() now return original termios to save an extra tcgetattr() call.

---------

Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2023-05-19 18:13:30 +00:00
Nikita Sobolev 27a7d5e1cd
gh-92248: Deprecate `type`, `choices`, `metavar` parameters of `argparse.BooleanOptionalAction` (#103678)
Co-authored-by: Kirill <80244920+Eclips4@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-05-19 16:44:43 +00:00
Youfu Zhang 9c5aa8967b
gh-96522: Fix deadlock in pty.spawn (#96639) 2023-05-19 13:22:43 +00:00
Mark Shannon c26d03d5d6
GH-102818: Do not call `PyTraceBack_Here` in sys.settrace trampoline. (GH-104579) 2023-05-19 12:40:48 +01:00