PyDev 调试器与命令行 django runserver 命令不同
我正在尝试使用 django 视图调试问题。 当我在命令行上运行它时。 我没有收到任何这些消息。 但是,当我在 PyDev 调试器中运行它时,我收到这些错误消息。 我正在使用 --noreload 选项运行。
这些错误消息是什么意思?
为什么我在命令行上运行时看不到它们?
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/threading.py:697: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
return _active[_get_ident()]
Exception exceptions.SystemError: 'error return without exception set' in <generator object at 0x786c10> ignored
Exception exceptions.SystemError: 'error return without exception set' in <generator object at 0x7904e0> ignored
I am trying to debug a problem with a django view. When I run it on the command line.
I don't get any of these messages. However when I run the it in the PyDev debugger i get these error messages. I am running with the --noreload option.
What do these error messages mean?
Why do I not get them when I run it on the command line?
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/threading.py:697: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
return _active[_get_ident()]
Exception exceptions.SystemError: 'error return without exception set' in <generator object at 0x786c10> ignored
Exception exceptions.SystemError: 'error return without exception set' in <generator object at 0x7904e0> ignored
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我似乎记得在 PyDev 中调试与 Django 测试服务器的自动重新加载机制相关的类似问题。 您可以通过将 --noreload 传递给 runserver 命令来关闭重新加载。 从那里,您只需训练自己在调试时更改代码后重新启动测试服务器即可。
编辑
我已经有一段时间没有将 PyDev 与 Django 一起使用了,但我确实记得有一些警告消息输出到控制台,但这并不影响我的调试能力。 在调试其他 Python 库时,有很多与该消息相关的留言板帖子,但我没有找到任何有解决方案的帖子。
我想只要您可以忽略它并仍然调试代码,它就是良性的。 我认为您不需要担心这是应用程序代码的问题,而是 PyDev 或 Python 调试工具的深层问题。
I seem to recall having similar issues debugging in PyDev related to the auto-reload mechanism of Django's test server. You can turn reloading off by passing --noreload to your runserver command. From there you just have to train yourself to restart your test server after making a code change while debugging.
EDIT
It's been a while since I used PyDev together with Django, but I do recall there being some warning messages spit out to the console that didn't affect my ability to debug. There are quite a few message board posts related to that message in debugging other Python libraries, but I didn't find any that have a resolution.
I guess it is benign as long as you can ignore it and still debug your code. I don't think you need to be concerned that it's a problem with your application code, but something deep down in PyDev or the Python debugging facilities.