Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pypy
pypy
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 594
    • Issues 594
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 10
    • Merge Requests 10
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

There will be about 1h of downtime on 2020-03-02 at 13:00 UTC+1 (change of servers and upgrade to Heptapod 0.20.0 final)

  • PyPy
  • pypypypy
  • Issues
  • #3355

Closed
Open
Opened Dec 01, 2020 by wyfo@wyfo

Internal error when annotated class variable has same name than local variable

Pypy version:

Python 3.6.9 (?, Apr 18 2020, 02:46:07)
[PyPy 7.3.1 with GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.59)] on darwin

Minimal example to reproduce:

def func():
    bar = None

    class Foo:
        bar: int = 0  # removing type annotation make the error disappear

        def get_bar(self):
            return bar

Traceback:

RPython traceback:
  File "pypy_interpreter.c", line 37239, in BuiltinCode_funcrun_obj
  File "pypy_module___builtin__.c", line 2951, in compile
  File "pypy_interpreter.c", line 56683, in PythonAstCompiler__compile_ast
  File "pypy_interpreter_astcompiler.c", line 1574, in compile_ast
  File "implement_2.c", line 27063, in dispatcher_86
  File "pypy_interpreter_astcompiler.c", line 24925, in PythonCodeGenerator__handle_body
  File "pypy_interpreter_astcompiler_2.c", line 22534, in PythonCodeGenerator_visit_FunctionDef
  File "pypy_interpreter_astcompiler_2.c", line 41494, in _visit_function__FunctionCodeGenerator
  File "pypy_interpreter_astcompiler_2.c", line 39257, in PythonCodeGenerator_sub_scope
  File "pypy_interpreter_astcompiler_3.c", line 19865, in FunctionCodeGenerator__compile
  File "pypy_interpreter_astcompiler_2.c", line 22254, in PythonCodeGenerator_visit_ClassDef
  File "pypy_interpreter_astcompiler_2.c", line 39257, in PythonCodeGenerator_sub_scope
  File "pypy_interpreter_astcompiler_2.c", line 19829, in ClassCodeGenerator__compile
  File "pypy_interpreter_astcompiler.c", line 24925, in PythonCodeGenerator__handle_body
  File "pypy_interpreter_astcompiler_2.c", line 22534, in PythonCodeGenerator_visit_FunctionDef
  File "pypy_interpreter_astcompiler_2.c", line 41510, in _visit_function__FunctionCodeGenerator
  File "pypy_interpreter_astcompiler_2.c", line 39984, in PythonCodeGenerator__make_function
SystemError: unexpected internal exception (please report a bug): <KeyError object at 0x107fcf010>; internal traceback was dumped to stderr
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: pypy/pypy#3355