PyDev.Debugger icon indicating copy to clipboard operation
PyDev.Debugger copied to clipboard

AssertionError with Cython modules (frozenlist._frozenlist) under Python 3.13 in PyDev debugger

Open icarocd opened this issue 6 months ago • 5 comments

AssertionError with Cython modules (frozenlist._frozenlist) under Python 3.13 in PyDev debugger

Environment

  • Python: 3.13.0 (official CPython)
  • PyDev.Debugger: 13.0.2 (bundled with Eclipse)
  • Eclipse
  • OS: Linux (Kubuntu 25.04)
  • Relevant C extension: frozenlist._frozenlist (used via aiohttp)

Problem

When running code with the debugger enabled in PyDev (Eclipse), I consistently hit this traceback when importing aiohttp, due to its internal use of the frozenlist Cython extension:

AssertionError: <code object _call_with_frames_removed at 0x..., file "<frozen importlib._bootstrap>", line 480> != <code object PyInit__frozenlist at 0x..., file "frozenlist/_frozenlist.pyx", line 1>

The traceback is triggered in: _pydevd_sys_monitoring_cython.pyx, line 607, _get_func_code_info


Context

  • The speedups were successfully compiled using:
    python3 setup_pydevd_cython.py build_ext --inplace
    
  • Still, the debugger crashes when any Cython-compiled module (specifically frozenlist) is imported during debugging.

Workaround

I was able to continue by monkey-patching the module like this:

import sys
try:
    import frozenlist._frozenlist
except AssertionError:
    if 'frozenlist._frozenlist' in sys.modules:
        del sys.modules['frozenlist._frozenlist']
    sys.modules['frozenlist._frozenlist'] = None

This avoids triggering PyDev's internal assertion and allows the debugger to proceed, at the cost of reduced performance in aiohttp.


Request

Please confirm whether full support for Python 3.13 + Cython extensions is expected in an upcoming PyDev.Debugger version.

Thanks for your great work on this project!

icarocd avatar Aug 05 '25 21:08 icarocd