summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-106145: Make `end_{lineno,col_offset}` required on `type_param` ↵Miss Islington (bot)2023-07-011-12/+6
| | | | | | | | nodes (GH-106224) (#106295) gh-106145: Make `end_{lineno,col_offset}` required on `type_param` nodes (GH-106224) (cherry picked from commit 46c1097868745eeb47abbc8af8c34e8fcb80ff1d) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-101006: Improve error handling when read marshal data (GH-101007) ↵Miss Islington (bot)2023-06-291-61/+71
| | | | | | | | | | | | (GH-106226) * EOFError no longer overrides other errors such as MemoryError or OSError at the start of the object. * Raise more relevant error when the NULL object occurs as a code object component. * Minimize an overhead of calling PyErr_Occurred(). (cherry picked from commit 8bf6904b229583033035d91a3800da5604dcaad4) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-106118: Add O_CLOEXEC preprocessor guard (GH-106120) (#106199)Miss Islington (bot)2023-06-281-1/+4
| | | | | (cherry picked from commit 6c60684bf5d34fae27a2f6a142ff794b38cefe1b) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-106030: Miscellaneous fixes in Python/suggestions.c (GH-106031) ↵Miss Islington (bot)2023-06-271-15/+27
| | | | | | (#106036) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-105979: Fix exception handling in `unmarshal_frozen_code` ↵Miss Islington (bot)2023-06-261-0/+1
| | | | | | | | (`Python/import.c`) (GH-105980) (#106055) gh-105979: Fix exception handling in `unmarshal_frozen_code` (`Python/import.c`) (GH-105980) (cherry picked from commit cd5280367a3a7065d13b8f7234474f7a2e9a18fd) Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
* [3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and Py… ↵Serhiy Storchaka2023-06-241-7/+5
| | | | | | | | | | (#106041) [3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code. (cherry picked from commit 1d33d5378058671bfabb6f4d4b5bfd4726973ff9)
* [3.12] gh-105908: fix `barry_as_FLUFL` future import (GH-105909) (#105930)Miss Islington (bot)2023-06-201-6/+10
| | | | | (cherry picked from commit 28187a9c4f95affe50fd37e0db0db177e2b9c2e9) Co-authored-by: Crowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com>
* [3.12] GH-105840: Fix assertion failures when specializing calls with too ↵Miss Islington (bot)2023-06-161-2/+2
| | | | | | | | many __defaults__ (GH-105863) GH-105840: Fix assertion failures when specializing calls with too many __defaults__ (GH-105847) (cherry picked from commit 2beab5bdef5fa2a00a59371e6137f769586b7404) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* [3.12] GH-105588: Add missing error checks to some obj2ast_* converters ↵Miss Islington (bot)2023-06-151-0/+7
| | | | | | | | (GH-105838) GH-105588: Add missing error checks to some obj2ast_* converters (GH-105589) (cherry picked from commit a4056c8f9c2d9970d39e3cb6bffb255cd4b8a42c) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* [3.12] gh-105699: Use a Thread-Local Variable for PKGCONTEXT (gh-105740) ↵Miss Islington (bot)2023-06-141-0/+15
| | | | | | | | (gh-105765) This fixes a race during import. The existing _PyRuntimeState.imports.pkgcontext is shared between interpreters, and occasionally this would cause a crash when multiple interpreters were importing extensions modules at the same time. To solve this we add a thread-local variable for the value. We also leave the existing state (and infrequent race) in place for platforms that do not support thread-local variables. (cherry picked from commit b87d2882754a7c273e2695c33384383eba380d7d) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-104812: Run Pending Calls in any Thread (gh-104813) (gh-105752)Eric Snow2023-06-144-83/+191
| | | | For a while now, pending calls only run in the main thread (in the main interpreter). This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run. (cherry picked from commit 757b402)
* [3.12] gh-105603: Change the PyInterpreterConfig.own gil Field (gh-105620) ↵Miss Islington (bot)2023-06-131-4/+15
| | | | | | | | (gh-105731) We are changing it to be more flexible that a strict bool can be for possible future expanded used cases. (cherry picked from commit b97e14a806477af4225777d215ac38c0d9b845f0) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [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*.