#25492 closed defect (fixed)

Fix nyx crashing when failing to write torrc.

Reported by: Guinness Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Nyx Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


When nyx tries to write torrc and fails, the exception handling was broken :

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/starter.py", line 118, in main
    nyx.curses.start(nyx.draw_loop, acs_support = config.get('acs_support', True), transparent_background = True, cursor = False)
  File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/curses.py", line 217, in start
  File "/usr/lib/python3.5/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/curses.py", line 215, in _wrapper
  File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/__init__.py", line 243, in draw_loop
  File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/panel/__init__.py", line 84, in handle
  File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/panel/config.py", line 222, in _show_write_dialog
    show_message('Unable to save configuration (%s)' % exc.strerror, HIGHLIGHT, max_wait = 2)
AttributeError: 'OperationFailed' object has no attribute 'strerror'

This commit patches this small bug, and add a more accurate exception handling for the save_conf call.

The commit can be found here : https://git.oudin.ml/Guinness/nyx/commit/8565384dc42b3f0faef027f890602b15513787be .

Child Tickets

Change History (2)

comment:1 Changed 21 months ago by atagar

Great, thanks Guinness! Fix pushed.

comment:2 Changed 21 months ago by atagar

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.