我对使用ipdb很陌生,下面的示例添加了
print "I see this print statement\n"
foo="bar"
import ipdb
ipdb.set_trace()
print "Never see this statement because program hangs:
print "But if the prior two debugging lines were removed it DOES show up"在我的代码中的某个时刻,在有一些数据问题的部分之前。通过添加这段代码,我的程序就挂起了:没有打印语句,没有断点,继续的唯一方法就是点击control。
这到底是怎么回事?
更新I关机/重新启动。这说明了一些问题:现在我可以进入ipdb提示符了。
ipdb> 但是,当我试图打印任何变量时,它仍然挂起:
ipdb. print foo发布于 2016-03-22 16:04:09
我的团队经常会出现这种情况,因为我们所有的AWS实例都通过NFS挂载共享主目录。当文件位于NFS文件系统上时,SQLite有一些问题。ipython (和ipdb)在幕后使用sqlite。
ipython的sqlite数据库路径是~/.ipython/profile_default/ipython y.sqite。
我的解决方案是用指向/var/tmp中空文件的符号链接替换该文件。
https://stackoverflow.com/questions/29055559
复制相似问题