模块 'trace' 在 PyCharm 中尝试调试时没有属性 'modname' (Python 3.6)

Module 'trace' has no attribute 'modname' while trying to debug in PyCharm (Python 3.6)

我从 official "pkg" bundle 为 Mac OS 安装了 Python 3.6rc1。现在,每次我在 PyCharm 中使用 "debug" 运行 配置(不依赖于特定脚本)时,我都会得到一个巨大的堆栈跟踪,其中包含以下错误消息(连续抛出多次):

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'

使用目前最新的PyCharm 2016.3。请注意,我可以使用相同的 PyCharm 实例使用 Python 2.7 或 3.5 进行调试,没有任何问题。

有人遇到过这样的事情吗?有解决方法吗?


在 SO 上发帖,因为我不确定这实际上是一个错误还是我配置错误;另外,我知道 PyCharm 团队会在此处检查 pycharm 标签;而且,其他人在这里比在 PyCharm 的错误跟踪器上更容易找到这个主题。

实际上有一个bug in the PyCharm's PyDev.Debugger,它使用了自Python 3.2:

之后不存在的trace.modname
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
    # ...

现在,仅当调试器使用 --save-signatures 命令行选项启动时才会执行此特定代码,该选项由 "Collect run-time types information for code insight" Python 调试器设置启用:

关闭设置,错误就会消失。