Error closing with Python 3.10 (PY_SSIZE_T_CLEAN)

Anki 2.1.48 (fb07bad3) Python 3.10.0 Qt 5.15.2 PyQt 5.15.4
Platform: Linux
Flags: frz=False ao=True sv=?
Add-ons, last update check: 2021-10-23 23:22:09

Caught exception:
Traceback (most recent call last):
File “/usr/lib64/python3.10/site-packages/aqt/”, line 54, in handler
File “/usr/lib64/python3.10/site-packages/aqt/”, line 133, in check_finished
File “/usr/lib64/python3.10/site-packages/aqt/”, line 541, in after_media_sync
File “/usr/lib64/python3.10/site-packages/aqt/”, line 436, in callback
File “/usr/lib64/python3.10/site-packages/aqt/”, line 445, in _unloadProfile
File “/usr/lib64/python3.10/site-packages/aqt/”, line 315, in save
self.db.execute(sql, self._pickle(self.profile),
File “/usr/lib64/python3.10/site-packages/aqt/”, line 291, in _pickle
return pickle.dumps(obj, protocol=4)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for ‘#’ formats

It’s a PyQt bug that only occurs on Python 3.10.

Wait for python update, thanks.

Updating Python won’t help. I’ve added a workaround in 2.1.49 which should avoid the issue.

2.1.49 perfect, thanks.