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

RegionFixer is not Python 3.10 compatible due to use of deprecated import in nbt.py #164

Closed
sebkuip opened this issue Oct 5, 2021 · 3 comments
Labels

Comments

@sebkuip
Copy link

sebkuip commented Oct 5, 2021

In the nbt.py file, the following import was done
from collections import MutableMapping, MutableSequence, Sequence

The importing of abc's from the collections library has been deprecated in python for a while. And has now been finally removed in python 3.10
https://bugs.python.org/issue25988
https://bugs.python.org/issue36952

\Minecraft-Region-Fixer-0.3.3>python regionfixer.py --help
Traceback (most recent call last):
    File "C:\Users\Sebastian Kuipers\Downloads\Minecraft-Region-Fixer-0.3.3\regionfixer.py", line 32, in <module>
        from regionfixer_core.interactive import InteractiveLoop
    File "C:\Users\Sebastian Kuipers\Downloads\Minecraft-Region-Fixer-0.3.3\regionfixer_core\interactive.py", line 28, in <module>
        from regionfixer_core import world
    File "C:\Users\Sebastian Kuipers\Downloads\Minecraft-Region-Fixer-0.3.3\regionfixer_core\world.py", line 30, in <module>
        import nbt.region as region
    File "C:\Users\Sebastian Kuipers\Downloads\Minecraft-Region-Fixer-0.3.3\nbt\__init__.py", line 2, in <module>
        from . import *
    File "C:\Users\Sebastian Kuipers\Downloads\Minecraft-Region-Fixer-0.3.3\nbt\nbt.py", line 7, in <module>
        from collections import MutableMapping, MutableSequence, Sequence
    ImportError: cannot import name 'MutableMapping' from 'collections' (C:\Program Files\Python310\lib\collections\__init__.py)

Desktop (please complete the following information):

  • OS: windows
  • Python version: 3.10
  • Region Fixer Version v 0.3.3 (latest from releases)

Additional context
Please don't use deprecated functions. The deprecationwarning is there for a reason.

@sebkuip sebkuip added the Bug label Oct 5, 2021
@Fenixin
Copy link
Owner

Fenixin commented Oct 5, 2021

Thanks for the heads up.

@macfreek
Copy link
Contributor

macfreek commented Oct 6, 2021

Upstream ticket: twoolie/NBT#154

@Fenixin
Copy link
Owner

Fenixin commented Nov 7, 2021

Just updated regionfixer with your branch fix-python-3.10 and everything seems to work as expected. Thanks a lot @macfreek for your update.

@sebkuip I'm going to close this, feel free to reopen if needed.

@Fenixin Fenixin closed this as completed Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants