Skip to content

[Bug] AttributeError: module 'collections' has no attribute 'Mapping' #479

@werdy77

Description

@werdy77

Describe the bug
Running nut 3.3 on Ubuntu 22.04.1 gives AttributeError message and not working.

$ python3.10 nut_gui.py 
Failed to load config file: conf/nut.conf
Traceback (most recent call last):
  File "nut_gui.py", line 11, in <module>
    import nut
  File "nut/__init__.py", line 24, in <module>
    import Fs
  File "Fs/__init__.py", line 1, in <module>
    from Fs.Xci import Xci
  File "Fs/Xci.py", line 2, in <module>
    from Fs.File import File
  File "Fs/File.py", line 4, in <module>
    from nut import Print
  File "nut/Print.py", line 1, in <module>
    from nut import Status
  File "nut/Status.py", line 4, in <module>
    from nut import Config
  File "nut/Config.py", line 871, in <module>
    load('conf/nut.conf')
  File "nut/Config.py", line 323, in load
    original = dict_merge(original, j)
  File "nut/Config.py", line 48, in dict_merge
    and isinstance(merge_dct[k], collections.Mapping)):
AttributeError: module 'collections' has no attribute 'Mapping'

NUT version (or git hash):

  • Nut: 3.3

Additional context
Solution is to modify nut/Config.py 6. line to

import collections.abc

and 48. line to

				and isinstance(merge_dct[k], collections.abc.Mapping)):

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions