I'm puzzled why this crashes. I can paste these two lines into a python shell and reliably get a segfault and be kicked out of the Python session:
from PyQt5.QtCore import QDate
QDate(2011, 1, 2).daysTo(QDate(2012, 1, 1))
Adding try/except won't catch anything.
Versions I'm using:
Python 3.10.6 (main, Aug 3 2022, 17:39:45) [GCC 12.1.1 20220730] on linux
from PyQt5.QtCore import QT_VERSION_STR
from PyQt5.Qt import PYQT_VERSION_STR
print(QT_VERSION_STR) # 5.15.4
print(PYQT_VERSION_STR) # 5.15.7