mirage
mirage copied to clipboard
Python 3.10: AttributeError: module 'collections' has no attribute 'Mapping'
Description
After upgrading to Python 3.10, the app fails to load with an exception: AttributeError: module 'collections' has no attribute 'Mapping'
Your environment
- OS or distribution: Arch Linux
- Architecture: x86 64bit
- Desktop environment: sway 1.6.1-2
- How did you install Mirage? AUR (yay)
- Python version: 3.10.1
Steps to reproduce
- Run mirage
Expected behavior
The app loads without errors.
Actual behavior
Error dialog is shown:
AttributeError: module 'collections' has no attribute 'Mapping'
Traceback (most recent call last):
File "qrc:/src/backend/matrix_client.py", line 404, in _start
sync_filter_ids = await self.sync_filter_ids()
File "qrc:/src/backend/matrix_client.py", line 500, in sync_filter_ids
utils.dict_update_recursive(first, self.low_limit_filter)
File "qrc:/src/backend/utils.py", line 73, in dict_update_recursive
isinstance(dict2[k], collections.Mapping)):
AttributeError: module 'collections' has no attribute 'Mapping'
Notes
Mapping
was moved to collections.abc
ever since Python 3.3 and now in Python 3.10 it is no longer in collections
, hence the error. Until now, there was a deprecation warning printed. Reference: python docs.
I was about to submit a PR but it seems there already is one fixing it nicely: #274 😅 👏
Same
Installed Mirage on Garuda Linux and am getting the very same error.
Anything I can do about this?
Installed Mirage on Garuda Linux and am getting the very same error.
Anything I can do about this?
Use my fork with fix on python3.10-collections
branch.
Just in case someone needs a mini-howto: install the matrix-mirage-git from the AUR and change in the PKGBUILD the line with source in: source=("git://github.com/vSLG/${_name}.git#branch=python3.10-collections")
For it works now perfect ;)
Where do I find said PKGBUILD file on my system?
I am used to APT, thus not very familiar with the Arch way - yet. :)
The Arch way is to read the Wiki as it is awesome and answers nearly every question: https://wiki.archlinux.org/title/Arch_User_Repository#Installing_and_upgrading_packages
Your question would not make sense if you would use the official way to build AUR packages and can not be answered if you don't tell us which AUR helper you use? For yay it is in ~/.cache/yay
but if you want to modify it better use the standard way described in the wiki.