Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Running Cython fails with 3.14.0a1 - a list attribute gets changed to None #125868

Copy link
Copy link
@da-woods

Description

@da-woods
Issue body actions

Bug report

Bug description:

To be clear - this issue is just about running the Cython itself (i.e. pure Python code). It is not about compiled extension modules.

To reproduce

  • Checkout Cython from git: https://github.com/cython/cython.git
  • git checkout daed3bce0bf0c6fb9012170cb479f64e8b9532cd (probably not important, but let's make sure we're all definitely starting from the same point).
  • python3.14 cython.py Cython/Compiler/Parsing.py - this runs Cython on one of its own files

You get an output that ends with

File 'ExprNodes.py', line 8643, in analyse_types: TupleNode(Parsing.py:750:34,
    is_sequence_constructor = 1,
    result_is_used = True,
    use_managed_ref = True)

Compiler crash traceback from this point on:
  File "/home/dave/Documents/programming/cython2/Cython/Compiler/ExprNodes.py", line 8643, in analyse_types
    if len(self.args) == 0:
       ~~~^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()

To try to debug it some more I add a constructor to TupleNode (in Cython/Compiler/ExprNodes.py at line 8627) with a breakpoint:

def __init__(self, pos, **kw):
        if "args" in kw and kw['args'] is None:
            breakpoint()
        super().__init__(pos, **kw)
> <fullpath>/Cython/Compiler/ExprNodes.py(8629)__init__()
-> breakpoint()
(Pdb) print(kw)
{'args': None}
(Pdb) up
> <fullpath>/Cython/Compiler/ExprNodes.py(6123)analyse_types()
-> self.arg_tuple = TupleNode(self.pos, args = self.args)
(Pdb) print(self.args)
[<Cython.Compiler.ExprNodes.NameNode object at 0x7fb636188c80>]
(Pdb) 

So the the constructor call to TupleNode args is None. But in the function it's being called from it's a list containing a NameNode (which is what I think it should be). That's as far as I've got with debugging.

This has apparently been bisected to #122620 (but not by me).

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.