Skip to content

Does debugpy still support Jython? #754

@doggnol

Description

@doggnol

Environment data

  • debugpy version: 1.5.0
  • OS and version: WIN10
  • Python version (& distribution if applicable, e.g. Anaconda): Jython 2.7.2
  • Using VS Code or Visual Studio: VS Code

Actual behavior

I was trying to debug jython program using vs code.
My plan is to start a debug server using debugpy, and launch vs code debug session in 'attach to' mode.
Codes are like:

def hello_world():
    print('hello world')

if __name__ == '__main__':
    hello_world()

And I started debug server using:

D:\software\jython\bin\jython.exe -m debugpy --listen localhost:5678 --wait-for-client .\main.py

Then just got an attribute error:

D:\software\jython\bin\jython.exe -m debugpy --listen localhost:5678 --wait-for-client .\main.py
  File "D:\software\jython\Lib\runpy.py", line 161, in _run_module_as_main
  File "D:\software\jython\Lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "D:\software\jython\Lib\site-packages\debugpy\__main__.py", line 43, in <module>
  File "D:\software\jython\Lib\site-packages\debugpy\server\__init__.py", line 9, in <module>
    import debugpy._vendored.force_pydevd  # noqa
  File "D:\software\jython\Lib\site-packages\debugpy\_vendored\force_pydevd.py", line 37, in <module>
    pydevd_constants = import_module('_pydevd_bundle.pydevd_constants')
  File "D:\software\jython\Lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "D:\software\jython\Lib\site-packages\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_constants.py", line 365, in <module>
    from _pydev_imps._pydev_saved_modules import thread, threading
  File "D:\software\jython\Lib\site-packages\debugpy\_vendored\pydevd\_pydev_imps\_pydev_saved_modules.py", line 97, in <module>
    import thread;    verify_shadowed.check(thread, ['start_new_thread', 'start_new', 'allocate_lock'])
  File "D:\software\jython\Lib\site-packages\debugpy\_vendored\pydevd\_pydev_imps\_pydev_saved_modules.py", line 73, in check
    msg = self._generate_shadowed_import_message([module.__file__])
AttributeError: type object 'org.python.modules.thread.thread' has no attribute '__file__'

I don't know if debugpy has loaded correct 'thread' module.
Or debugpy is no longer supported for Jython.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions