summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-105673: Fix uninitialized warning in sysmodule.c (GH-105674) (#105675)Miss Islington (bot)2023-06-121-1/+1
| | | | | | In sys_add_xoption(), 'value' may be uninitialized for some error paths. (cherry picked from commit a8d69fe92c65d636fc454cfb1825c357eb2e6325) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-105375: Improve error handling in the sys extension module ↵Miss Islington (bot)2023-06-111-6/+18
| | | | | | | | | | (GH-105611) (#105665) In _PySys_AddXOptionWithError() and sys_add_xoption(), bail on first error to prevent exceptions from possibly being overwritten. (cherry picked from commit 41cddc2e93a285b81fa30ac542b088bd9d0112e9) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-105375: Improve PyErr_WarnExplicit() error handling (GH-105610) ↵Miss Islington (bot)2023-06-111-12/+16
| | | | | | | | | (#105659) Bail on first error to prevent exceptions from possibly being overwritten. (cherry picked from commit 567d6ae8e77579173510fc948ac06b2ababf3d40) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-105375: Improve error handling in the builtins extension module ↵Miss Islington (bot)2023-06-111-8/+32
| | | | | | | (GH-105585) (#105649) (cherry picked from commit d4fa52934a282df51cff800eee5caeb94a229547) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-105375: Improve error handling in compiler_enter_scope() ↵Miss Islington (bot)2023-06-091-1/+5
| | | | | | | (GH-105494) (#105581) (cherry picked from commit 6c832ddcf28187f86100c790afb16a0223d945d0) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-105564: Don't include artificial newlines in the line attribute of ↵Miss Islington (bot)2023-06-091-0/+3
| | | | | | tokens (GH-105565) (#105579) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.12] gh-100227: Lock Around Modification of the Global Allocators State ↵Miss Islington (bot)2023-06-081-1/+2
| | | | | | | | (gh-105516) (gh-105532) The risk of a race with this state is relatively low, but we play it safe anyway. We do avoid using the lock in performance-sensitive cases where the risk of a race is very, very low. (cherry picked from commit 68dfa496278aa21585eb4654d5f7ef13ef76cb50) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-100227: Lock Around Adding Global Audit Hooks (gh-105515) (gh-105525)Eric Snow2023-06-082-20/+43
| | | | The risk of a race with this state is relatively low, but we play it safe anyway. (cherry picked from commit e822a676f1f3bef6c5413e9b856db481c08ac2a5)
* [3.12] gh-100227: Lock Around Use of the Global "atexit" State (gh-105514) ↵Miss Islington (bot)2023-06-082-25/+27
| | | | | | | | (gh-105517) The risk of a race with this state is relatively low, but we play it safe anyway. (cherry picked from commit 7799c8e678f759c7787785c6287140abe641d1b9) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-105390: Add explicit type cast (GH-105466) (#105472)Miss Islington (bot)2023-06-071-1/+2
|
* [3.12] gh-105435: Fix spurious NEWLINE token if file ends with comment ↵Miss Islington (bot)2023-06-071-0/+11
| | | | without a newline (GH-105442) (#105444)
* [3.12] gh-105390: Correctly raise TokenError instead of SyntaxError for ↵Miss Islington (bot)2023-06-071-7/+2
| | | | tokenize errors (GH-105399) (#105439)
* [3.12] gh-105259: Ensure we don't show newline characters for trailing ↵Miss Islington (bot)2023-06-061-4/+6
| | | | NEWLINE tokens (GH-105364) (#105367)
* [3.12] gh-105164: Detect annotations inside match blocks (GH-105177) (#105313)Miss Islington (bot)2023-06-051-0/+10
| | | | | (cherry picked from commit 69d1245685cf95ddc678633e978a56673da64865) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.12] gh-105184: document that marshal functions can fail and need to be ↵Miss Islington (bot)2023-06-021-0/+4
| | | | | | | | checked with PyErr_Occurred (GH-105185) (#105218) gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (GH-105185) (cherry picked from commit ee26ca13a129da8cf549409d0a1b2e892ff2b4ec) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.12] gh-104799: Default missing lists in AST to the empty list (GH-104834) ↵Miss Islington (bot)2023-06-021-219/+365
| | | | | | | | (#105213) (cherry picked from commit 77d25795862f19c6e3d647b76cfb10d5ce1f149c) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-104341: Call _PyEval_ReleaseLock() with NULL When Finalizing the ↵Miss Islington (bot)2023-06-013-8/+45
| | | | | | | | | | Current Thread (gh-105109) (gh-105209) This avoids the problematic race in drop_gil() by skipping the FORCE_SWITCHING code there for finalizing threads. (The idea for this approach came out of discussions with @markshannon.) (cherry picked from commit 3698fda) Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
* [3.12] gh-105069: Add a readline-like callable to the tokenizer to consume ↵Miss Islington (bot)2023-05-312-22/+31
| | | | | | | | input iteratively (GH-105070) (#105119) gh-105069: Add a readline-like callable to the tokenizer to consume input iteratively (GH-105070) (cherry picked from commit 9216e69a87d16d871625721ed5a8aa302511f367) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.12] gh-105042: Disable unmatched parens syntax error in python tokenize ↵Miss Islington (bot)2023-05-311-1/+1
| | | | | | | | (GH-105061) (#105120) gh-105042: Disable unmatched parens syntax error in python tokenize (GH-105061) (cherry picked from commit 70f315c2d6de87b0514ce16cc00a91a5b60a6098) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* [3.12] gh-105035: fix super() calls on unusual types (e.g. meta-types) ↵Miss Islington (bot)2023-05-302-221/+225
| | | | | | | | (GH-105094) (#105117) gh-105035: fix super() calls on unusual types (e.g. meta-types) (GH-105094) (cherry picked from commit 68c75c31536e8c87901934f2d6da81f54f4334f9) Co-authored-by: Carl Meyer <carl@oddbird.net>
* [3.12] gh-104799: Move location of type_params AST fields (GH-104828) (#104974)Miss Islington (bot)2023-05-301-163/+162
| | | | | | | gh-104799: Move location of type_params AST fields (GH-104828) (cherry picked from commit ba73473f4c18ba4cf7ab18d84d94a47d2d37a0c5) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104820: Fixes os.stat on Windows to better handle file systems that do ↵Miss Islington (bot)2023-05-291-1/+2
| | | | | | | not support FileIdInformation (GH-104892) (cherry picked from commit 6031727a37c6003f78e3b0c7414a0a214855dd08) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.12] gh-105017: Include CRLF lines in strings and column numbers ↵Miss Islington (bot)2023-05-281-2/+7
| | | | | | | | | (GH-105030) (#105041) gh-105017: Include CRLF lines in strings and column numbers (GH-105030) (cherry picked from commit 96fff35325e519cc76ffacf22e57e4c393d4446f) Co-authored-by: Marta Gómez Macías <mgmacias@google.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* [3.12] gh-104976: Ensure trailing dedent tokens are emitted as the previous ↵Miss Islington (bot)2023-05-261-3/+23
| | | | tokenizer (GH-104980) (#105000)
* [3.12] gh-104972: Ensure that line attributes in tokens in the tokenize ↵Miss Islington (bot)2023-05-261-5/+4
| | | | | | | | module are correct (GH-104975) (#104982) gh-104972: Ensure that line attributes in tokens in the tokenize module are correct (GH-104975) (cherry picked from commit 3fdb55c48291a459fb1e33edb5140ec0383222df) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.12] gh-104825: Remove implicit newline in the line attribute in tokens ↵Pablo Galindo Salgado2023-05-241-0/+4
| | | | | emitted in the tokenize module (GH-104846). (#104850) (cherry picked from commit c8cf9b42eb2bfbd4c3e708ec28d32430248a1d7a)
* gh-104741: Add line number attribute to indentation error exception (#104743)Marta Gómez Macías2023-05-221-6/+9
|
* gh-104656: Rename typeparams AST node to type_params (#104657)Jelle Zijlstra2023-05-225-219/+221
|
* gh-102856: Tokenize performance improvement (#104731)Marta Gómez Macías2023-05-221-1/+16
|
* gh-104686: Fix tracing for decorated classes (#104708)Jelle Zijlstra2023-05-211-0/+4
|
* gh-103295: expose API for writing perf map files (#103546)gsallam2023-05-213-69/+96
| | | | | 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>
* gh-102856: Python tokenizer implementation for PEP 701 (#104323)Marta Gómez Macías2023-05-212-22/+140
| | | | | | | | | | | 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>
* gh-104640: Disallow walrus in comprehension within type scopes (#104641)Jelle Zijlstra2023-05-191-4/+31
|
* GH-102818: Do not call `PyTraceBack_Here` in sys.settrace trampoline. ↵Mark Shannon2023-05-191-4/+0
| | | | (GH-104579)
* gh-104619: never leak comprehension locals to outer locals() (#104637)Carl Meyer2023-05-191-21/+19
|
* gh-104602: ensure all cellvars are known up front (#104603)Carl Meyer2023-05-192-20/+21
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-104615: don't make unsafe swaps in apply_static_swaps (#104620)Carl Meyer2023-05-182-2/+24
|
* GH-96803: Document and test new unstable internal frame API functions ↵Mark Shannon2023-05-181-2/+2
| | | | | | (GH-104211) Weaken contract of PyUnstable_InterpreterFrame_GetCode to return PyObject*.
* GH-104580: Don't cache eval breaker in interpreter (GH-104581)Mark Shannon2023-05-184-258/+256
| | | Move eval-breaker to the front of the interpreter state.
* gh-104374: Remove access to class scopes for inlined comprehensions (#104528)Jelle Zijlstra2023-05-182-7/+18
| | | Co-authored-by: Carl Meyer <carl@oddbird.net>
* GH-101520: Move tracemalloc functionality into core, leaving interface in ↵Mark Shannon2023-05-172-3/+1564
| | | | Modules. (#104508)
* gh-104572: Improve error messages for invalid constructs in PEP 695 contexts ↵Jelle Zijlstra2023-05-171-4/+4
| | | | (#104573)
* GH-103906: Remove immortal refcounting in the interpreter (GH-103909)Brandt Bucher2023-05-162-509/+473
|
* gh-103865: add monitoring support to LOAD_SUPER_ATTR (#103866)Carl Meyer2023-05-166-229/+309
|
* gh-103763: Implement PEP 695 (#103764)Jelle Zijlstra2023-05-1611-626/+2291
| | | | | | | | | | | | | | This implements PEP 695, Type Parameter Syntax. It adds support for: - Generic functions (def func[T](): ...) - Generic classes (class X[T](): ...) - Type aliases (type X = ...) - New scoping when the new syntax is used within a class body - Compiler and interpreter changes to support the new syntax and scoping rules Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Eric Traut <eric@traut.com> Co-authored-by: Larry Hastings <larry@hastings.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104482: Fix error handling bugs in ast.c (#104483)Irit Katriel2023-05-152-19/+38
|
* gh-104341: Adjust tstate_must_exit() to Respect Interpreter Finalization ↵Eric Snow2023-05-155-6/+32
| | | | | (gh-104437) With the move to a per-interpreter GIL, this check slipped through the cracks.
* gh-101819: Isolate `_io` (#101948)Erlend E. Aasland2023-05-151-10/+0
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-87092: avoid gcc warning on uninitialized struct field in assemble.c ↵Dong-hee Na2023-05-141-1/+2
| | | | (#104460)
* gh-104404: fix crasher with nested comprehensions plus lambdas (#104442)Carl Meyer2023-05-131-7/+14
|