8000 regression pop from empty dequeue · Issue #267 · nix-gui/nix-gui · GitHub
[go: up one dir, main page]

Skip to content

regression pop from empty dequeue #267

Open

Description

@lapp0

Arya K of Nix-Gui matrix reports

Traceback (most recent call last):
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 57, in set_lookup_key
    self.set_option_path(
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 91, in set_option_path
    num_children = len(api.get_option_tree().children(option_path, mode="leaves"))
  Fil
8000
e "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/utils/cache.py", line 85, in wrapper
    res = function(*args, **kwargs)
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/api.py", line 22, in get_option_tree
    return option_tree.OptionTree(
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/option_tree.py", line 68, in __init__
    self._upsert_node_data(
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/option_tree.py", line 99, in _upsert_node_data
    if self._is_attribute_set(parent_option_path) and child_option_path.get_end() != '<name>':
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/option_tree.py", line 120, in _is_attribute_set
    return isinstance(data.get_type(), types.AttrsOfType)
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/option_tree.py", line 30, in get_type
    return types.from_nix_type_str(self._type_string)
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/types.py", line 31, in from_nix_type_str
    from_nix_type_str(nix_type_str.removeprefix('attribute set of ').removesuffix('s'))
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/types.py", line 58, in from_nix_type_str
    return from_nix_type_str(nix_type_str, or_legal=False)
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/types.py", line 217, in from_nix_type_str
    raise ValueError(nix_type_str)
ValueError: Nix config atom (null, bool, int, float, str, path or package) or list of Nix config atom (null, bool, int, float, str, path or package)s

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/bin/.nix-gui-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/main.py", line 69, in main
    run_program()
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/main.py", line 50, in run_program
    nix_gui = main_window.NixGuiMainWindow(statemodel)
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/graphics/main_window.py", line 17, in __init__
    nav_interface.OptionNavigationInterface(statemodel=statemodel)
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 39, in __init__
    self.set_lookup_key(starting_lookup_key)
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 66, in set_lookup_key
    self.revert_to_previous_lookup_key()
  File "/nix/store/0b0a3l9brj46wm1jya6sc75p4ary19pi-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 46, in revert_to_previous_lookup_key
    previous_uri = self.uri_stack.pop()
IndexError: pop from an empty deque

This should have been resolved in #162 need to investigate why this cropped up again.

the reporters nix-shell -p nix-info --run "nix-info -m":

system: "x86_64-linux"
host os: Linux 5.10.98, NixOS, 22.05 (Quokka)
multi-user?: yes
sandbox: yes
version: nix-env (Nix) 2.6.0
channels(root): "nixos-22.05pre353535.48d63e924a2, nix-ld"
channels(ak): "home-manager"
nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Activity

  1. milahu commented on Sep 1, 2022

    @milahu
    Contributor

    seems a problem with path=['boot', 'loader', 'grub', 'mirroredBoots', '*']

    debug.patch
    diff --git a/nixui/graphics/nav_interface.py b/nixui/graphics/nav_interface.py
    index 815ef3c..9f162cc 100644
    --- a/nixui/graphics/nav_interface.py
    +++ b/nixui/graphics/nav_interface.py
    @@ -36,33 +36,45 @@ class OptionNavigationInterface(QtWidgets.QWidget):
     
             self.setLayout(vbox)
     
    +        print(f'OptionNavigationInterface: starting_lookup_key={starting_lookup_key}')
             self.set_lookup_key(starting_lookup_key)
     
             # when undo is called, refresh option path
             self.statemodel.slotmapper.add_slot('reload_attribute', self.set_option_path)
     
         def revert_to_previous_lookup_key(self):
    +        print(f'revert_to_previous_lookup_key: self.uri_stack = {self.uri_stack}')
             current_uri = self.uri_stack.pop()
    +        print(f'revert_to_previous_lookup_key: current_uri = {current_uri}')
             previous_uri = self.uri_stack.pop()
    +        print(f'revert_to_previous_lookup_key: previous_uri = {previous_uri}')
             self.set_lookup_key(previous_uri)
             logger.info(f'reverted from "{current_uri}" to previous URI: "{previous_uri}"')
     
         def set_lookup_key(self, lookup_key=None):
    +        print(f'set_lookup_key: lookup_key={lookup_key}')
             if lookup_key is None:
    +            print(f'set_lookup_key: lookup_key is None -> revert_to_previous_lookup_key')
                 return self.revert_to_previous_lookup_key()
    -
             try:
                 if lookup_key.startswith('options:'):
    +                print(f'set_lookup_key: lookup_key starts with options')
                     option_str = lookup_key.removeprefix('options:')
    -                self.set_option_path(
    -                    Attribute(option_str)
    -                )
    +                print(f'set_lookup_key: option_str={option_str}')
    +                option_path = Attribute(option_str)
    +                print(f'set_lookup_key: set_option_path: option_path={option_path}')
    +                self.set_option_path(option_path)
                 elif lookup_key.startswith('search:'):
    +                print(f'set_lookup_key: lookup_key starts with search')
                     search_str = lookup_key.removeprefix('search:')
    +                print(f'set_lookup_key: set_search_query: search_str={search_str}')
                     self.set_search_query(search_str)
                 else:
    +                print(f'set_lookup_key: lookup_key start is wrong -> ValueError')
                     raise ValueError
    -        except ValueError:
    +        except ValueError as e:
    +            print(f'set_lookup_key: ValueError:', e)
    +            print(f'set_lookup_key: ValueError -> revert_to_previous_lookup_key')
                 self.revert_to_previous_lookup_key()
                 logger.warning(f'Invalid lookup key: {lookup_key}, reverting')
     
    @@ -83,6 +95,12 @@ class OptionNavigationInterface(QtWidgets.QWidget):
                                           options than this number, render a navlist with option_path selected and all descendents
                                           shown in the option display.
             """
    +        print(f'set_option_path: option_path={option_path}')
    +        # FIXME handle empty option_path
    +
    +        print(f'set_option_path: self.uri_stack={self.uri_stack}')
    +
    +        print(f'set_option_path: self.uri_stack.append options:{option_path}')
             self.uri_stack.append(f'options:{option_path}')
     
             self.nav_bar.replace_widget(
    diff --git a/nixui/options/attribute.py b/nixui/options/attribute.py
    index dec0f4f..25d6a34 100644
    --- a/nixui/options/attribute.py
    +++ b/nixui/options/attribute.py
    @@ -3,6 +3,7 @@ import functools
     import re
     from typing import List
     import csv
    +import traceback
     
     
     @dataclass(frozen=True)
    @@ -10,10 +11,20 @@ class Attribute:
         loc: List[str] = field(default_factory=list)
     
         def __init__(self, path):
    +        # TODO trace
    +        if (
    +            path == ['boot', 'loader', 'grub', 'mirroredBoots']
    +            or
    +            path == ['boot', 'loader', 'grub', 'mirroredBoots', '*']
    +        ):
    +            print(f'nixui.options.attribute.Attribute: path={path} -> traceback')
    +            traceback.print_stack()
    +        if isinstance(path, str):
    +            # parse string to list
    +            path = next(csv.reader([path], delimiter='.', quotechar='"'))
             if isinstance(path, list):
    +            print(f'nixui.options.attribute.Attribute: path={path}')
                 object.__setattr__(self, 'loc', path)
    -        elif isinstance(path, str):
    -            object.__setattr__(self, 'loc', next(csv.reader([path], delimiter='.', quotechar='"')))
             else:
                 raise TypeError(str(type(path)), path)
     
    Details
    OptionNavigationInterface: starting_lookup_key=options:
    set_lookup_key: lookup_key=options:
    set_lookup_key: lookup_key starts with options
    set_lookup_key: option_str=
    nixui.options.attribute.Attribute: path=[]
    set_lookup_key: set_option_path: option_path=
    set_option_path: option_path=
    set_option_path: self.uri_stack=deque([])
    set_option_path: self.uri_stack.append options:
    nixui.options.attribute.Attribute: path=[]
    nixui.options.attribute.Attribute: path=[]
    nixui.options.attribute.Attribute: path=['_module']
    nixui.options.attribute.Attribute: path=['_module', 'args']
    nixui.options.attribute.Attribute: path=[]
    nixui.options.attribute.Attribute: path=['appstream']
    nixui.options.attribute.Attribute: path=['appstream', 'enable']
    nixui.options.attribute.Attribute: path=[]
    nixui.options.attribute.Attribute: path=['boot']
    nixui.options.attribute.Attribute: path=['boot', 'binfmt']
    nixui.options.attribute.Attribute: path=['boot', 'binfmt', 'emulatedSystems']
    nixui.options.attribute.Attribute: path=[]
    nixui.options.attribute.Attribute: path=['boot']
    nixui.options.attribute.Attribute: path=['boot', 'binfmt']
    nixui.options.attribute.Attribute: path=['boot', 'binfmt', 'registrations']
    nixui.options.attribute.Attribute: path=[]
    nixui.options.attribute.Attribute: path=['boot']
    nixui.options.attribute.Attribute: path=['boot', 'binfmt']
    nixui.options.attribute.Attribute: path=['boot', 'binfmt', 'registrations']
    nixui.options.attribute.Attribute: path=['boot', 'binfmt', 'registrations', '<name>']
    nixui.options.attribute.Attribute: path=['boot', 'binfmt', 'registrations', '<name>', 'fixBinary']
    nixui.options.attribute.Attribute: path=[]
    
    ...
    
    nixui.options.attribute.Attribute: path=[]
    nixui.options.attribute.Attribute: path=['boot']
    nixui.options.attribute.Attribute: path=['boot', 'loader']
    nixui.options.attribute.Attribute: path=['boot', 'loader', 'grub']
    
    nixui.options.attribute.Attribute: path=['boot', 'loader', 'grub', 'mirroredBoots'] -> traceback
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/bin/.nix-gui-wrapped", line 9, in <module>
        sys.exit(main())
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/main.py", line 69, in main
        run_program()
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/main.py", line 50, in run_program
        nix_gui = main_window.NixGuiMainWindow(statemodel)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/main_window.py", line 17, in __init__
        nav_interface.OptionNavigationInterface(statemodel=statemodel)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 40, in __init__
        self.set_lookup_key(starting_lookup_key)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 66, in set_lookup_key
        self.set_option_path(option_path)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 109, in set_option_path
        num_children = len(api.get_option_tree().children(option_path, mode="leaves"))
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/utils/cache.py", line 85, in wrapper
        res = function(*args, **kwargs)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/api.py", line 22, in get_option_tree
        return option_tree.OptionTree(
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/option_tree.py", line 68, in __init__
        self._upsert_node_data(
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/option_tree.py", line 96, in _upsert_node_data
        child_option_path = Attribute.from_insertion(parent_option_path, option_path_key)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/attribute.py", line 33, in from_insertion
        return cls(attribute_set.loc + [attribute])
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/attribute.py", line 21, in __init__
        traceback.print_stack()
    
    nixui.options.attribute.Attribute: path=['boot', 'loader', 'grub', 'mirroredBoots']
    
    nixui.options.attribute.Attribute: path=['boot', 'loader', 'grub', 'mirroredBoots', '*'] -> traceback
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/bin/.nix-gui-wrapped", line 9, in <module>
        sys.exit(main())
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/main.py", line 69, in main
        run_program()
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/main.py", line 50, in run_program
        nix_gui = main_window.NixGuiMainWindow(statemodel)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/main_window.py", line 17, in __init__
        nav_interface.OptionNavigationInterface(statemodel=statemodel)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 40, in __init__
        self.set_lookup_key(starting_lookup_key)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 66, in set_lookup_key
        self.set_option_path(option_path)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 109, in set_option_path
        num_children = len(api.get_option_tree().children(option_path, mode="leaves"))
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/utils/cache.py", line 85, in wrapper
        res = function(*args, **kwargs)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/api.py", line 22, in get_option_tree
        return option_tree.OptionTree(
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/option_tree.py", line 68, in __init__
        self._upsert_node_data(
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/option_tree.py", line 96, in _upsert_node_data
        child_option_path = Attribute.from_insertion(parent_option_path, option_path_key)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/attribute.py", line 33, in from_insertion
        return cls(attribute_set.loc + [attribute])
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/attribute.py", line 21, in __init__
        traceback.print_stack()
    
    nixui.options.attribute.Attribute: path=['boot', 'loader', 'grub', 'mirroredBoots', '*']
    set_lookup_key: ValueError: list of submodule
    set_lookup_key: ValueError -> revert_to_previous_lookup_key
    revert_to_previous_lookup_key: self.uri_stack = deque(['options:'])
    revert_to_previous_lookup_key: current_uri = options:
    
    Traceback (most recent call last):
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 66, in set_lookup_key
        self.set_option_path(option_path)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 109, in set_option_path
        num_children = len(api.get_option_tree().children(option_path, mode="leaves"))
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/utils/cache.py", line 85, in wrapper
        res = function(*args, **kwargs)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/api.py", line 22, in get_option_tree
        return option_tree.OptionTree(
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/option_tree.py", line 68, in __init__
        self._upsert_node_data(
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/option_tree.py", line 99, in _upsert_node_data
        if self._is_attribute_set(parent_option_path) and child_option_path.get_end() != '<name>':
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/option_tree.py", line 120, in _is_attribute_set
        return isinstance(data.get_type(), types.AttrsOfType)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/option_tree.py", line 30, in get_type
        return types.from_nix_type_str(self._type_string)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/options/types.py", line 217, in from_nix_type_str
        raise ValueError(nix_type_str)
    ValueError: list of submodule
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/bin/.nix-gui-wrapped", line 9, in <module>
        sys.exit(main())
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/main.py", line 69, in main
        run_program()
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/main.py", line 50, in run_program
        nix_gui = main_window.NixGuiMainWindow(statemodel)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/main_window.py", line 17, in __init__
        nav_interface.OptionNavigationInterface(statemodel=statemodel)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 40, in __init__
        self.set_lookup_key(starting_lookup_key)
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 78, in set_lookup_key
        self.revert_to_previous_lookup_key()
      File "/nix/store/qrjvvlkyy9vr2648k05s8p4d34vrlwkg-python3.9-nix-gui-0.1.6/lib/python3.9/site-packages/nixui/graphics/nav_interface.py", line 49, in revert_to_previous_lookup_key
        previous_uri = self.uri_stack.pop()
    IndexError: pop from an empty deque
    

    which causes ValueError: list of submodule
    from nixui/options/types.py

    def from_nix_type_str(nix_type_str, or_legal=True):
        # ...
        else:
            raise ValueError(nix_type_str)

    actual vs expected:

    -list of submodule
    +list of submodules

    "proper" fix: add more values for nix_type_str
    quickfix:

     def from_nix_type_str(nix_type_str, or_legal=True):
         # ...
         else:
    -        raise ValueError(nix_type_str)
    +        return AnythingType()

    ... but now im getting TypeError: unhashable type: 'list'

    nixui.options.attribute.Attribute: path=['services', 'public-inbox', 'settings', 'coderepo', '<name>', 'cgitUrl']
    Traceback (most recent call last):
      File "/nix/store/0y8m1qlzga5f3jc9ya7zz5nivlbby11j-python3-3.9.4/lib/python3.9/runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "/nix/store/0y8m1qlzga5f3jc9ya7zz5nivlbby11j-python3-3.9.4/lib/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/main.py", line 73, in <module>
        main()
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/main.py", line 69, in main
        run_program()
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/main.py", line 50, in run_program
        nix_gui = main_window.NixGuiMainWindow(statemodel)
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/graphics/main_window.py", line 17, in __init__
        nav_interface.OptionNavigationInterface(statemodel=statemodel)
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/graphics/nav_interface.py", line 40, in __init__
        self.set_lookup_key(starting_lookup_key)
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/graphics/nav_interface.py", line 66, in set_lookup_key
        self.set_option_path(option_path)
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/graphics/nav_interface.py", line 110, in set_option_path
        num_children = len(api.get_option_tree().children(option_path, mode="leaves"))
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/utils/cache.py", line 85, in wrapper
        res = function(*args, **kwargs)
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/options/api.py", line 22, in get_option_tree
        return option_tree.OptionTree(
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/options/option_tree.py", line 68, in __init__
        self._upsert_node_data(
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/options/option_tree.py", line 108, in _upsert_node_data
        _type=self.get_type(parent_option_path).child_type or Undefined
      File "/home/user/src/nixos/nix-gui-clean/nix-gui/nixui/options/types.py", line 353, in child_type
        possibilities = tuple(set([
      File "<string>", line 3, in __hash__
    TypeError: unhashable type: 'list'
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0