blawar / nut

GNU General Public License v3.0
1.12k stars 193 forks source link

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

Open werdy77 opened 11 months ago

werdy77 commented 11 months ago

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

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)):
introkun commented 6 months ago

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

privacy313 commented 1 month ago

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