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/progress.py”, line 54, in handler
func()
File “/usr/lib64/python3.10/site-packages/aqt/mediasync.py”, line 133, in check_finished
on_finished()
File “/usr/lib64/python3.10/site-packages/aqt/main.py”, line 541, in after_media_sync
onsuccess()
File “/usr/lib64/python3.10/site-packages/aqt/main.py”, line 436, in callback
self._unloadProfile()
File “/usr/lib64/python3.10/site-packages/aqt/main.py”, line 445, in _unloadProfile
self.pm.save()
File “/usr/lib64/python3.10/site-packages/aqt/profiles.py”, line 315, in save
self.db.execute(sql, self._pickle(self.profile), self.name)
File “/usr/lib64/python3.10/site-packages/aqt/profiles.py”, 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.