nut icon indicating copy to clipboard operation
nut copied to clipboard

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

Open werdy77 opened this issue 1 year ago • 2 comments

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

werdy77 avatar Oct 18 '23 20:10 werdy77

try this https://github.com/blawar/nut/pull/490

introkun avatar Mar 26 '24 03:03 introkun

also getting same error. OPs edits to Config.py will get things launching again but folder scanning appears to be broken by that change.

privacy313 avatar Aug 17 '24 19:08 privacy313