Commit graph

118809 commits

Author SHA1 Message Date
Miss Islington (bot)
b670214636
[3.12] gh-104879: Fix TypeAliasType.__module__ in exec() (GH-104881) (#104890)
(cherry picked from commit fe77a99fc8)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-24 19:30:57 +00:00
Miss Islington (bot)
3d91d034a0
[3.12] Improve test coverage for is_typeddict (GH-104884) (#104889)
Improve test coverage for is_typeddict (GH-104884)

In particular, it's important to test that is_typeddict(TypedDict)
returns False.
(cherry picked from commit 1497607a8e)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-24 19:21:28 +00:00
Miss Islington (bot)
ddc29c8fdb
[3.12] gh-104866: Tokenize should emit NEWLINE after exiting block with comment (GH-104870) (#104872)
gh-104866: Tokenize should emit NEWLINE after exiting block with comment (GH-104870)
(cherry picked from commit c90a862cdc)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-05-24 14:41:58 -04:00
Ned Deily
45b88e0653
gh-103207: The macOS 13 Ventura Installer.app permission problem is fixed by Apple in macOS 13.4. (GH-104883) 2023-05-24 18:32:50 +00:00
Terry Jan Reedy
2b54ea5ba2
[3.12] gh-104825: add omitted idlelib text fix (#104880)
Order of events:
Terry merged new idlelib test into main.
Ms. I. made a 3.12 backport; tests passed.
Pablo merged the tokenize change with idlelib test fix into main.
Pablo merged a 3.12 backport without the idle test fix
as the backport of the latter had not yet been been merged.
Terry merged the idlelib test backport.  The new test failed
on at least 4 3.12 buildbots because of the tokenize change.
This PR backports the now needed idlelib test fix.

(cherry picked from commit c8cf9b4)
2023-05-24 17:41:50 +00:00
Miss Islington (bot)
25890ebbb8
[3.12] gh-102856: Update "Formatted string literals" docs section after PEP701 (GH-104861) (#104865)
(cherry picked from commit 8e5b3b90c8)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-05-24 15:40:31 +02:00
Miss Islington (bot)
5e1799ea2e
[3.12] gh-104719: IDLE - test existence of all tokenize references. (GH-104767) (#104844)
gh-104719: IDLE - test existence of all tokenize references. (GH-104767)

Class editor.IndentSearcher contains all editor references to tokenize module.
Module io tokenize reference cover those other modules.

(cherry picked from commit e561c09975)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-24 08:46:22 -04:00
Dong-hee Na
b151660883
[3.12] gh-101282: Enclose BOLT_APPLY_FLAGS value in double quotes (gh… (gh-104853)
[3.12] gh-101282: Enclose BOLT_APPLY_FLAGS value in double quotes (gh-104752)
(cherry picked from commit c43785192c)
2023-05-24 10:47:07 +00:00
Pablo Galindo Salgado
3d2ed8991f
[3.12] gh-104825: Remove implicit newline in the line attribute in tokens emitted in the tokenize module (GH-104846). (#104850)
(cherry picked from commit c8cf9b42eb)
2023-05-24 10:40:51 +00:00
Miss Islington (bot)
2d685eca8a
[3.12] gh-102856: Add missing quote to fix doctest (GH-104852) (#104854)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-05-24 10:21:59 +00:00
Miss Islington (bot)
a5c0ef87a1
[3.12] gh-102856: Add changes related to PEP 701 in 3.12 What's New docs (GH-104824) (#104847)
gh-102856: Add changes related to PEP 701 in 3.12 What's New docs (GH-104824)
(cherry picked from commit c45701e9ef)

Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-24 11:00:34 +01:00
Miss Islington (bot)
d10d1e3b10
[3.12] gh-104797: Allow Protocols to inherit from collections.abc.Buffer (GH-104827) (#104841)
gh-104797: Allow Protocols to inherit from collections.abc.Buffer (GH-104827)
(cherry picked from commit c0ab7d401c)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-24 09:05:34 +00:00
Miss Islington (bot)
b719dd8725
[3.12] gh-104372: use == -1 before PyErr_Occurred (GH-104831) (#104833)
gh-104372: use == -1 before PyErr_Occurred (GH-104831)

The ideal pattern for this.  (already in the 3.11 backport)
(cherry picked from commit 7f963bfc79)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-05-24 04:40:21 +00:00
Miss Islington (bot)
22c45c49bb
[3.12] gh-103295: fix stack overwrite on 32-bit in perf map test harness (GH-104811) (#104823)
gh-103295: fix stack overwrite on 32-bit in perf map test harness (GH-104811)
(cherry picked from commit e0b3078705)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-05-23 22:34:50 +00:00
Miss Islington (bot)
5c8418c5cc
[3.12] Remove gh-103207 changelog item as it was never part of any release. (GH-104815)
(cherry picked from commit 08b4eb83aa)

Co-authored-by: Ned Deily <nad@python.org>
2023-05-23 16:04:44 -04:00
Itamar Ostricher
f4e2049f14
[3.12] gh-104271: Fix auto() fallback in case of mixed type Enum (GH-104279)
gh-104271: Fix auto() fallback in case of mixed type Enum
2023-05-23 11:11:35 -07:00
Miss Islington (bot)
9aea1f28e2
[3.12] gh-99108: Release the GIL around hashlib built-in computation (GH-104675) (#104776)
gh-99108: Release the GIL around hashlib built-in computation (GH-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.
(cherry picked from commit 2e5d8a90aa)

Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
2023-05-23 11:24:02 +00:00
Miss Islington (bot)
e43fbbd928
[3.12] GH-101291: Avoid using macros with casts in low-level long API. (GH-104742) (#104759)
(cherry picked from commit e295d86056)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2023-05-23 09:28:04 +00:00
Miss Islington (bot)
905d419cac
[3.12] GH-104668: Don't call PyOS_* hooks in subinterpreters (GH-104760)
GH-104668: Don't call PyOS_* hooks in subinterpreters (GH-104674)
(cherry picked from commit 357bed0bcd)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2023-05-23 09:24:28 +00:00
Miss Islington (bot)
25b5ce72c9
[3.12] howto/urllib2: remove link to an outdated french translation (GH-104193) (#104758)
We now have our own translation and it's not outdated
(cherry picked from commit 151b6bfb5d)

Co-authored-by: Mathieu Dupuy <deronnax@gmail.com>
2023-05-23 08:57:52 +00:00
Petr Viktorin
b44beac5e1
[3.12] gh-87891: Add ABI check to CI (#104793)
Backport the workflow change and fix-ups:
- GH-92442 (e89c01eac7)
- GH-94129 (0dadb2249a)
- GH-98556 (194588decc)

Co-Authored-By: sterliakov <50529348+sterliakov@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-05-23 10:56:14 +02:00
Miss Islington (bot)
97f8547913
[3.12] Add the 3.12 branch to the github workflows. (GH-104768) (#104769)
Add the 3.12 branch to the github workflows. (GH-104768)
(cherry picked from commit 4194d8f2c4)

Co-authored-by: T. Wouters <thomas@python.org>
2023-05-23 01:20:05 +02:00
Thomas Wouters
c2b127ed3a Post 3.12.0b1 2023-05-22 21:11:08 +02: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
Marta Gómez Macías
729b252241
gh-104741: Add line number attribute to indentation error exception (#104743) 2023-05-22 11:30:18 +00:00
Cristián Maureira-Fredes
0a7796052a
gh-102856: Allow comments inside multi-line f-string expresions (#104006) 2023-05-22 10:30:07 +00: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
6fba031476
Update macOS installer ReadMe and Welcome screens for 3.12.0b1. (GH-104739) 2023-05-22 06:43:43 +00: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
Kumar Aditya
b9c807a260
GH-103092: isolate _ssl (#104725) 2023-05-22 06:14:48 +05:30
Marta Gómez Macías
8817886ae5
gh-102856: Tokenize performance improvement (#104731) 2023-05-22 00:29:04 +00:00
Alex Waygood
4b107d86f3
gh-104683: clinic.py: Modernise parse_converter() using pattern-matching (#104696) 2023-05-21 23:29:43 +00:00
Jelle Zijlstra
cd9748409a
gh-104686: Fix tracing for decorated classes (#104708) 2023-05-21 16:20:19 -07:00
Alex Waygood
64d1b44a54
gh-104683: clinic.py: Improve coverage for the parse_converter method (#104729) 2023-05-21 23:00:47 +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
Erlend E. Aasland
6ba8406cb6
gh-104050: Add more type annotations to Argument Clinic (#104631)
Annotate methods of the following classes:

- class Function
- class Parameter
- class LandMine
2023-05-21 21:24:26 +00:00
Erlend E. Aasland
bf6dd8f5fd
gh-104050: Add basic type hints to Argument Clinic clinic class (#104705)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-21 20:49:34 +00:00
Erlend E. Aasland
c482e9a4e6
gh-104050: Annotate Argument Clinic return converters (#104706)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-21 20:23:14 +00:00
Hugo van Kemenade
5841fbc1a2
gh-103857: Document utcnow and utcfromtimestamp deprecations in What's New (#104542)
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2023-05-21 13:45:44 -06:00
Terry Jan Reedy
0c5e79bcdf
gh-104719: IDLE - delete useless monkeypatch of tokenize (#104726) 2023-05-21 18:42:26 +00:00
Marta Gómez Macías
ffe47cb623
gh-104719: Restore Tokenize module constants (#104722) 2023-05-21 17:07:28 +01: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
Jelle Zijlstra
ab71acd67b
typing docs: Move some classes out of the "Generics" section (#104707)
- AnyStr can be used in type annotations, contrary to the section header
- Unpack can also be used in annotations, and its use is not restricted
  to generics. It makes more sense with other building blocks like Required.
- Protocol is not necessarily generic.

Also fix the indentation for two notes associated with Concatenate.

Split off from #104642, but I think this change is independently an
improvement.
2023-05-21 06:00:50 -07:00
Dong-hee Na
b9fcfa6024
gh-104717: Add comment about manual loop unrolling (gh-104718) 2023-05-21 21:08:28 +09:00
Zac Hatfield-Dodds
014dd301b5
gh-86275: improve Hypothesis configuration for CI and local runs (#104468) 2023-05-21 05:52:29 -06: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
Dong-hee Na
2e91c7e626
gh-104469: Convert _testcapi/exceptions to use AC (gh-104502) 2023-05-21 18:39:45 +09:00