当我的(python2.7)程序退出时,有很多被忽略的异常。但是由于项目规模很大,而且基于他人开发的项目,很难用这样的信息来定位bug。有没有什么方法可以获取异常跟踪,或者其他方法可以帮助您?谢谢。你知道吗
Exception TypeError: "'NoneType' object is not callable" in <object repr() failed> ignored
Exception TypeError: "'NoneType' object is not callable" in <object repr() failed> ignored
Exception TypeError: "'NoneType' object is not callable" in <object repr() failed> ignored
...
Exception TypeError: "'NoneType' object is not callable" in <object repr() failed> ignored
您可以运行:
我会扫描代码库中与输出匹配的字符串。像
Exception .* ignored
这样的异常和对象信息很可能是格式化变量。这应该找到生成输出的语句。你知道吗一旦找到这些语句,假设它们位于try/except块中,就可以使用traceback模块中的工具打印回溯,或者,如果正在使用logging包,则将关键字参数
exc_info=True
传递给日志method。你知道吗还值得扫描一下sys.excepthook是否被覆盖。你知道吗
相关问题 更多 >
编程相关推荐