[tor-commits] [nyx/master] Stacktrace when transversing the menu on Gentoo

atagar at torproject.org atagar at torproject.org
Mon Oct 30 23:30:07 UTC 2017


commit b4989bf41ec6613575366b3cbabd4a1dae630fd3
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Oct 30 16:27:49 2017 -0700

    Stacktrace when transversing the menu on Gentoo
    
    Interesting catch from Toralf. I'm not entirely sure if this is it but if he
    was using python3 it makes sense that keys() provides an iterator whereas
    reversed() expects a collection. Not able to repro it though so not sure if
    this is what's at play...
    
      Traceback (most recent call last):
        File "./run_nyx", line 14, in <module>
          nyx.main()
        File "/root/nyx/nyx/__init__.py", line 147, in main
          nyx.starter.main()
        File "/root/nyx/stem/util/conf.py", line 289, in wrapped
          return func(*args, config = config, **kwargs)
        File "/root/nyx/nyx/starter.py", line 94, in main
          nyx.curses.start(nyx.draw_loop, acs_support = config.get('acs_support', True), transparent_background = True, cursor = False)
        File "/root/nyx/nyx/curses.py", line 216, in start
          curses.wrapper(_wrapper)
        File "/usr/lib64/python3.4/curses/__init__.py", line 94, in wrapper
          return func(stdscr, *args, **kwds)
        File "/root/nyx/nyx/curses.py", line 214, in _wrapper
          function()
        File "/root/nyx/nyx/__init__.py", line 192, in draw_loop
          nyx.menu.show_menu()
        File "/root/nyx/nyx/menu.py", line 203, in show_menu
          menu = _make_menu()
        File "/root/nyx/nyx/menu.py", line 243, in _make_menu
          submenu = panel.submenu()
        File "/root/nyx/nyx/panel/log.py", line 273, in submenu
          [RadioMenuItem(opt, filter_group, opt) for opt in self._filter.latest_selections()],
        File "/root/nyx/nyx/log.py", line 432, in latest_selections
          return list(reversed(self._past_filters.keys()))
      TypeError: argument to reversed() must be a sequence
---
 nyx/log.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nyx/log.py b/nyx/log.py
index f1a4ff0..a3ad194 100644
--- a/nyx/log.py
+++ b/nyx/log.py
@@ -429,7 +429,7 @@ class LogFilters(object):
     return self._selected
 
   def latest_selections(self):
-    return list(reversed(self._past_filters.keys()))
+    return list(reversed(list(self._past_filters.keys())))
 
   def match(self, message):
     regex_filter = self._past_filters.get(self._selected)



More information about the tor-commits mailing list