Opened 2 years ago

Closed 2 years ago

#26026 closed defect (fixed)

ValueError: "blue" isn't a valid color - color_interface is not working

Reported by: cypherpunks Owned by: atagar
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Archived/Nyx Version: Tor:
Severity: Normal Keywords: color blue
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:



I came across an error while editing my configuration file for nyx.
When I choose the color "blue" as shown on the NYX-configuration page as an exsample, the error ""blue" isn't a valid color" is recived.

In fact none of the colors for "color_interface" work.

Configuration file /home/<user>/.nyx/config/nyxrc

graph_stat bandwidth
graph_bound tight
max_graph_width 200
show_interpreter false
connection_rate 10
#acs_support true
color_override blue
#color_interface false

Error from python3

Traceback (most recent call last):
  File "/usr/local/bin/nyx", line 11, in <module>
    load_entry_point('nyx==2.0.4.dev0', 'console_scripts', 'nyx')()
  File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/", line 176, in main
  File "/usr/local/lib/python3.5/dist-packages/stem-1.6.0-py3.5.egg/stem/util/", line 289, in wrapped
    return func(*args, config = config, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/", line 75, in main
  File "/usr/local/lib/python3.5/dist-packages/stem-1.6.0-py3.5.egg/stem/util/", line 503, in load
    self.load(os.path.join(root, filename))
  File "/usr/local/lib/python3.5/dist-packages/stem-1.6.0-py3.5.egg/stem/util/", line 526, in load
    self.set(key, value.strip(), False)
  File "/usr/local/lib/python3.5/dist-packages/stem-1.6.0-py3.5.egg/stem/util/", line 654, in set
    listener(self, key)
  File "/usr/local/lib/python3.5/dist-packages/stem-1.6.0-py3.5.egg/stem/util/", line 190, in update
    interceptor_value = self.interceptor(key, new_value)
  File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/", line 173, in conf_handler
    raise ValueError('"%s" isn\'t a valid color' % value)
ValueError: "blue" isn't a valid color

Best regards and thanks for the good work.


Child Tickets

Change History (1)

comment:1 Changed 2 years ago by atagar

Resolution: fixed
Status: newclosed

Thanks cypherpunks, great catch! Fixed. You can sidestep this bug by providing a camelcase color name 'color_override Blue').

Note: See TracTickets for help on using tickets.