1
我很驚訝地發現,斷點的存在可以改變一個pyqtgraph對象(python2.7)的行爲。pyqtgraph古怪與pdb一起使用
這裏有一個最小的工作示例:
import pyqtgraph as pg
pg.mkQApp()
pw = pg.PlotWidget()
p1 = pw.plotItem
p1.showAxis('right')
#import pdb; pdb.set_trace() # Running once with this line, once without
print p1.getAxis('right').rect().width()
運行:
# No breakpoint:
% python qtg_pdb_bug.py
0.0
# With breakpoint:
% python qtg_pdb_bug.py
> qtg_pdb_bug.py(7)<module>()
-> print p1.getAxis('right').rect().width()
(Pdb) c
35.0
問題:
- 出於好奇:在這將導致此怪事斷點處停止時,會發生什麼?這是pyqtgraph中的錯誤嗎?
- 這是正確的/預期的結果? 0或35?
嗯,*我*獲得退出分段錯誤。我認爲這是對潛在問題的暗示。 – Veedrac
@Veedrac從我的經驗來看,它是rt *不會在pyqtgraph退出時得到* segfault。不完全確定這是pyqtgraph的錯誤,但必須源自底層軟件包。 – shx2
這聽起來令人愉快:P。祝你好運。 – Veedrac