mutagen icon indicating copy to clipboard operation
mutagen copied to clipboard

collections renamed to collections.abc

Open ballynakill-waif opened this issue 2 months ago • 0 comments

It seems that there where some changes to the structure of the package, and my usage of pip install doesn't clear it up.

 mutagen-inspect -h
Traceback (most recent call last):
  File "/Users/hecate/.pyenv/versions/3.11.4/bin/mutagen-inspect", line 12, in <module>
    from mutagen._tools.mutagen_inspect import entry_point
  File "/Users/hecate/.pyenv/versions/3.11.4/lib/python3.11/site-packages/mutagen/_tools/mutagen_inspect.py", line 11, in <module>
    from mutagen._senf import print_, argv
  File "/Users/hecate/.pyenv/versions/3.11.4/lib/python3.11/site-packages/mutagen/_senf/__init__.py", line 32, in <module>
    from ._stdlib import sep, pathsep, curdir, pardir, altsep, extsep, devnull, \
  File "/Users/hecate/.pyenv/versions/3.11.4/lib/python3.11/site-packages/mutagen/_senf/_stdlib.py", line 28, in <module>
    from ._environ import environ
  File "/Users/hecate/.pyenv/versions/3.11.4/lib/python3.11/site-packages/mutagen/_senf/_environ.py", line 133, in <module>
    class Environ(collections.MutableMapping):
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'MutableMapping'

after fixing the file my self with:

import collections.abc as collections

that's the _environ.py, ~/.pyenv/versions/3.11.4/lib/python3.11/site-packages/mutagen/_senf/_environ.py. I still receive more errors

mutagen-inspect -h
Traceback \(most recent call last\):
  File \"/Users/hecate/.pyenv/versions/3.11.4/bin/mutagen-inspect\", line 12, in <module>
    from mutagen._tools.mutagen_inspect import entry_point
  File \"/Users/hecate/.pyenv/versions/3.11.4/lib/python3.11/site-packages/mutagen/_tools/mutagen_inspect.py\", line 11, in <module>
    from mutagen._senf import print_, argv
  File \"/Users/hecate/.pyenv/versions/3.11.4/lib/python3.11/site-packages/mutagen/_senf/__init__.py\", line 34, in <module>
    from ._argv import argv
  File \"/Users/hecate/.pyenv/versions/3.11.4/lib/python3.11/site-packages/mutagen/_senf/_argv.py\", line 60, in <module>
    class Argv\(collections.MutableSequence\):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module \'collections\' has no attribute \'MutableSequence\'

which makes me feel like this is a daisy chain of errors that could be better addressed some other way other than changing these files.

note

I had to change both importation lines concerning the module collections to

import collections.abc as collections

in both, ~/.pyenv/versions/3.11.4/lib/python3.11/site-packages/mutagen/_senf/_argv.py, and ~/.pyenv/versions/3.11.4/lib/python3.11/site-packages/mutagen/_senf/_environ.py in order to get things working -- in order to get the binaries from this package working again. I'm using python 3.11.4 and I use pyenv if that is useful.

ballynakill-waif avatar Apr 30 '24 14:04 ballynakill-waif