python 3.4 pycharm调试器中的AssertionError

时间:2014-02-17 12:05:53

标签: python debugging python-3.x assert pycharm

我安装了Pycharm 3.1(最新版本),它应该支持python 3.4,但是,今天早上它在我运行调试器时开始抛出异常。我有什么办法可以解决这个断言错误吗?

    C:\Python34\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py" --multiproc --client 127.0.0.1 --port xx --file C:/Users/xx/PycharmProjects/drop/my_file.py
Connected to pydev debugger (build 133.881)
pydev debugger: process 8492 is connecting

None
Exception in thread pydevd.CheckAliveThread:
Traceback (most recent call last):
  File "C:\Python34\lib\threading.py", line 921, in _bootstrap_inner
    self.run()
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd_comm.py", line 252, in run
    self.OnRun()
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 187, in OnRun
    self.stop()
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd_comm.py", line 262, in stop
    _Thread_stop(self)
  File "C:\Python34\lib\threading.py", line 990, in _stop
    assert not lock.locked()
AssertionError

Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 996, in trace_dispatch
    if not t.isAlive():
  File "C:\Python34\lib\threading.py", line 1120, in is_alive
    self._wait_for_tstate_lock(False)
  File "C:\Python34\lib\threading.py", line 1076, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError

Process finished with exit code -1

- 编辑 -

我最终删除.py文件并在新文件中重新创建代码,之后调试器正常工作。 我不确定是什么腐蚀了这些文件,但我注意到它发生在几个不同的场合。 AssertionError就是其中之一。 另一次.py文件被破坏,解释器抛出一个异常,我还没有为unicode char支持定义编码样式,即使我有

# -*- coding: utf-8 -*-

令我感到惊讶的是,即使在删除整个代码(包括# - - coding:utf-8 - - )并且基本上调用一个简单的print()函数之后,它仍会继续抛出错误!然后我再次完全删除文件并从头开始。我感到非常震惊,我不知道这是怎么发生的。

2 个答案:

答案 0 :(得分:5)

我在 Windows 中使用 PyCharm 3.1.1 Python 3.4.0 来解决此问题。

这是一个错误(http://youtrack.jetbrains.com/issue/PY-12317),标记为"已在3.1.2"中修复。

因此,我在JetBrains PyCharm Preview (EAP)页面下载了PyCharm 3.1.2RC2(build 133.1143)。并且,该版本解决了这个问题。

答案 1 :(得分:0)

我的Mac版本遇到了同样的问题,http://download.jetbrains.com/python/pycharm-community-133.1262.dmg解决了它