Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.10: AttributeError: module 'collections' has no attribute 'Mapping' #275

Open
Dejvino opened this issue Dec 15, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@Dejvino
Copy link

Dejvino commented Dec 15, 2021

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

  1. 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.

@Dejvino Dejvino added the bug Something isn't working label Dec 15, 2021
@Dejvino
Copy link
Author

Dejvino commented Dec 15, 2021

I was about to submit a PR but it seems there already is one fixing it nicely: #274 😅 👏

@KSPAtlas
Copy link

Same

@IngwiePhoenix
Copy link

Installed Mirage on Garuda Linux and am getting the very same error.

Anything I can do about this?

@vSLG
Copy link
Contributor

vSLG commented Dec 24, 2021

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.

@Thorgrimson
Copy link

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 ;)

@IngwiePhoenix
Copy link

Where do I find said PKGBUILD file on my system?

I am used to APT, thus not very familiar with the Arch way - yet. :)

@DrRac27
Copy link

DrRac27 commented Dec 27, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants