The trace module does not have the modname attribute when trying to debug in PyCharm (Python 3.6)

I have Python 3.6rc1 installed from the official pkg package for Mac OS. Now, every time I use the "debug" launch configuration in PyCharm (it does not depend on a specific script), I get a huge stack trace with the following error messages (several times in a row)

Traceback (most recent call last): File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_signature.py", line 88, in create_signature filename, modulename, funcname = self.file_module_function_of(frame) File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_signature.py", line 102, in file_module_function_of modulename = trace.modname(filename) AttributeError: module 'trace' has no attribute 'modname' 

Using current PyCharm 2016.3. Note that I can debug using Python 2.7 or 3.5 using the same PyCharm instance without any problems.

Has anyone experienced anything like this? Is there a workaround?


Posting to SO, as I'm not quite sure if this is actually a bug, or I misconfigured something; plus, I know that the PyCharm team checks the pycharm tag pycharm ; and, it would be easier for others to find this topic here, and not on the PyCharm tracker.

+6
source share
1 answer

There is actually a bug in PyCharm PyDev.Debugger , it uses trace.modname , which does not exist with Python 3.2:

 def file_module_function_of(self, frame): #this code is take from trace module and fixed to work with new-style classes code = frame.f_code filename = code.co_filename if filename: modulename = trace.modname(filename) # < HERE else: modulename = None # ... 

Now this specific code will be executed only if the debugger is launched with the command-line --save-signatures , which is activated by the "Collect runtime data to determine the code" command. Setting up the Python debugger:

enter image description here

Turn off the installation and the error will disappear.

+9
source

Source: https://habr.com/ru/post/1013110/


All Articles