| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
| |
(cherry picked from commit 6c60684bf5d34fae27a2f6a142ff794b38cefe1b)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
|
|
|
|
|
|
| |
(#106036)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
| |
(`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>
|
|
|
|
|
|
|
|
|
|
| |
(#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)
|
|
|
|
|
| |
(cherry picked from commit 28187a9c4f95affe50fd37e0db0db177e2b9c2e9)
Co-authored-by: Crowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
|
|
|
|
| |
(#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>
|
|
|
|
|
|
|
| |
(GH-105585) (#105649)
(cherry picked from commit d4fa52934a282df51cff800eee5caeb94a229547)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
|
| |
(GH-105494) (#105581)
(cherry picked from commit 6c832ddcf28187f86100c790afb16a0223d945d0)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
| |
tokens (GH-105565) (#105579)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
| |
The risk of a race with this state is relatively low, but we play it safe anyway.
(cherry picked from commit e822a676f1f3bef6c5413e9b856db481c08ac2a5)
|
|
|
|
|
|
|
|
| |
(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>
|
| |
|
|
|
|
| |
without a newline (GH-105442) (#105444)
|
|
|
|
| |
tokenize errors (GH-105399) (#105439)
|
|
|
|
| |
NEWLINE tokens (GH-105364) (#105367)
|
|
|
|
|
| |
(cherry picked from commit 69d1245685cf95ddc678633e978a56673da64865)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
(#105213)
(cherry picked from commit 77d25795862f19c6e3d647b76cfb10d5ce1f149c)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
not support FileIdInformation (GH-104892)
(cherry picked from commit 6031727a37c6003f78e3b0c7414a0a214855dd08)
Co-authored-by: Steve Dower <steve.dower@python.org>
|
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
| |
tokenizer (GH-104980) (#105000)
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
emitted in the tokenize module (GH-104846). (#104850)
(cherry picked from commit c8cf9b42eb2bfbd4c3e708ec28d32430248a1d7a)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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-104579)
|
| |
|
|
|
| |
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| |
|
|
|
|
|
|
| |
(GH-104211)
Weaken contract of PyUnstable_InterpreterFrame_GetCode to return PyObject*.
|