bytes\str error on debug

Hello. PyCharm 2020.1.3, Windows 10, Python 3.7.8 (yes, I've checked it, it is significant).

When I try to attach to a process, I got the following error:

Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.3\plugins\python-ce\helpers\pydev\pydevd_attach_to_process\attach_pydevd.py", line 86, in <module>
main(process_command_line(sys.argv[1:]))
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.3\plugins\python-ce\helpers\pydev\pydevd_attach_to_process\attach_pydevd.py", line 82, in main
setup['pid'], python_code, connect_debugger_tracing=True, show_debug_info=show_debug_info_on_target_process)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.3\plugins\python-ce\helpers\pydev\pydevd_attach_to_process\add_code_to_python_process.py", line 320, in run_python_code_windows
process.scan_modules()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.3\plugins\python-ce\helpers\pydev\pydevd_attach_to_process\winappdbg\module.py", line 1071, in scan_modules
fileName = PathOperations.native_to_win32_pathname(fileName)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.3\plugins\python-ce\helpers\pydev\pydevd_attach_to_process\winappdbg\util.py", line 315, in native_to_win32_pathname
if not device_native_path.endswith(compat.b('\\')):
TypeError: endswith first arg must be str or a tuple of str, not bytes

I tried to manage this and saw: compat.b returns 'bytes' type, in Python 3 and is an str is passed. '\\' is str, so we got bytes as a result of compat.b(). But 'endwith' function expects the str, not bytes!

How could it be? How does it work for other people and you?

 

 

 

3 comments
Comment actions Permalink

Additional. The location of compat.py:

C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.2\plugins\python-ce\helpers\pydev\pydevd_attach_to_process\winappdbg\compat.py

(The PyCharm version looks another, yes.)

0
Comment actions Permalink

Additional: I reproduced the issue on PyCharm 2020.3.4.

0
Comment actions Permalink

Hello, 

The issue has been reported https://youtrack.jetbrains.com/issue/PY-47935, please follow it for updates. 

 

 

0

Please sign in to leave a comment.