Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rwid.widget.columns.ColumnsError: added content invalid #217

Open
acuteaura opened this issue Mar 4, 2024 · 1 comment
Open

rwid.widget.columns.ColumnsError: added content invalid #217

acuteaura opened this issue Mar 4, 2024 · 1 comment

Comments

@acuteaura
Copy link

acuteaura commented Mar 4, 2024

Step 1: Describe your environment

  • System (Intel/AMD/Raspberry Pi etc): Framework 13 AMD 7840U
  • OS version: NixOS Unstable
  • s-tui version: 1.1.6
  • Installation method(pip/PPA/source code): nixpkgs

Step 2: Describe the problem:

Observed Results:

Traceback (most recent call last):
  File "/nix/store/108cyd84hzcyrc2sv6836llbhvfk2a51-python3.11-s-tui-1.1.6/bin/.s-tui-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/108cyd84hzcyrc2sv6836llbhvfk2a51-python3.11-s-tui-1.1.6/lib/python3.11/site-packages/s_tui/s_tui.py", line 958, in main
    graph_controller = GraphController(args)
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/108cyd84hzcyrc2sv6836llbhvfk2a51-python3.11-s-tui-1.1.6/lib/python3.11/site-packages/s_tui/s_tui.py", line 773, in __init__
    self.view = GraphView(self)
                ^^^^^^^^^^^^^^^
  File "/nix/store/108cyd84hzcyrc2sv6836llbhvfk2a51-python3.11-s-tui-1.1.6/lib/python3.11/site-packages/s_tui/s_tui.py", line 237, in __init__
    urwid.WidgetPlaceholder.__init__(self, self.main_window())
                                           ^^^^^^^^^^^^^^^^^^
  File "/nix/store/108cyd84hzcyrc2sv6836llbhvfk2a51-python3.11-s-tui-1.1.6/lib/python3.11/site-packages/s_tui/s_tui.py", line 569, in main_window
    summaries = self._generate_summaries()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/108cyd84hzcyrc2sv6836llbhvfk2a51-python3.11-s-tui-1.1.6/lib/python3.11/site-packages/s_tui/s_tui.py", line 510, in _generate_summaries
    fixed_stats += summary.get_text_item_list()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/108cyd84hzcyrc2sv6836llbhvfk2a51-python3.11-s-tui-1.1.6/lib/python3.11/site-packages/s_tui/sturwid/summary_text_list.py", line 46, in get_text_item_list
    col_w = urwid.Columns([("weight", 1.5, label_w), value_w])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ql86jf1cm1vlghvyrb320kajhkjm2jnj-python3.11-urwid-2.6.2/lib/python3.11/site-packages/urwid/widget/columns.py", line 264, in __init__
    self.contents.append((w, (WHSettings.WEIGHT, width, i in box_columns)))
  File "/nix/store/ql86jf1cm1vlghvyrb320kajhkjm2jnj-python3.11-urwid-2.6.2/lib/python3.11/site-packages/urwid/monitored_list.py", line 417, in append
    focus = self._adjust_focus_on_contents_modified(slice(len(self), len(self)), [item])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ql86jf1cm1vlghvyrb320kajhkjm2jnj-python3.11-urwid-2.6.2/lib/python3.11/site-packages/urwid/monitored_list.py", line 285, in _adjust_focus_on_contents_modified
    focus = self._validate_contents_modified(indices, new_items)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ql86jf1cm1vlghvyrb320kajhkjm2jnj-python3.11-urwid-2.6.2/lib/python3.11/site-packages/urwid/widget/columns.py", line 306, in _validate_contents_modified
    raise ColumnsError(f"added content invalid: {invalid_items!r}")
urwid.widget.columns.ColumnsError: added content invalid: [(<Text fixed/flow widget 'Temp'>, (<WHSettings.WEIGHT: 'weight'>, 1.5, False))]

Debug Results, output of s-tui -d created in a file _s-tui.log:

same traceback, no additional output

Step 3: Reproduce the problem:

Steps to reproduce:

Unknown. s-tui has not been updated since the problem appeared, must be some data it consumes?

@jfly
Copy link

jfly commented Mar 5, 2024

I think it's ok to close this issue.

This looks like it's a bug in urwid v2.6.2, fixed by urwid/urwid@36bf037. nixpkgs does not yet have urwid 2.6.3+, so that's the issue.

I've submitted a PR to nixpkgs to bump urwid to a version with the fix: NixOS/nixpkgs#293419.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants