[英]Why are python traceback messages not displayed?
I am trying to convert a python 2 library to python 3. I managed to convert a good part thanks to the python traceback error messages displayed in the terminal.我正在尝试将 python 2库转换为 python 3。由于终端中显示的 python 回溯错误消息,我设法转换了一个很好的部分。 But part of this library, which is a web server serving as IDE, does not display error messages making conversion difficult.
但是这个库的一部分,它是一个用作 IDE 的 Web 服务器,不显示错误消息,使转换变得困难。
Why are python traceback messages not displayed?为什么不显示 python 回溯消息? Is there a way to display them?
有没有办法显示它们?
I found that we could set 'sys.tracebacklimit = 0' to hide the traceback but it didn't have an effect in my case setting it to 1000.我发现我们可以设置 'sys.tracebacklimit = 0' 来隐藏回溯,但在我的情况下将其设置为 1000 没有效果。
As the veteran of a large Python 3 conversion, a few thoughts:作为大Python 3转换的老手,几点感想:
python setup.py check
).python setup.py check
)。 That should be your guide as to the correctness of your conversion, not the absence of errors in manual use. TLDR: Don't get hung up on trying to surface errors from the server right now. TLDR:不要急于立即从服务器中发现错误。 Use the tests to find the stuff you need to fix.
使用测试来查找您需要修复的内容。 Use Futurize.
使用未来化。
(I recently gave a "Porting 100,000 lines of Python 2 to Python 3" talk if you're interested.) (如果您有兴趣,我最近发表了“将 100,000 行 Python 2 移植到 Python 3”的演讲。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.