ActivityWatch / aw-qt

Tray icon that manages ActivityWatch processes, built with Qt.
Mozilla Public License 2.0
27 stars 29 forks source link

Broken error handling when a module crashes #22

Closed johan-bjareholt closed 6 years ago

johan-bjareholt commented 7 years ago

A bug where aw-qt crashes when trying to fetch and log stderr from a crashing module.

https://github.com/ActivityWatch/activitywatch/issues/85

Reading active process stderr...
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aw_qt-0.1-py3.6.egg/aw_qt/trayicon.py", line 110, in rebuild_modules_menu
show_module_failed_dialog(module)
  File "/usr/lib/python3.6/site-packages/aw_qt-0.1-py3.6.egg/aw_qt/trayicon.py", line 96, in show_module_failed_dialog
    box.setDetailedText(module.stderr())
  File "/usr/lib/python3.6/site-packages/aw_qt-0.1-py3.6.egg/aw_qt/manager.py", line 108, in stderr
    self._log += self._process.stderr.read()
AttributeError: 'NoneType' object has no attribute 'read'
ErikBjare commented 7 years ago

I think this was caused due to no longer setting using stderr=PIPE on the Popen.

We could try to use a temp file for buffering, or we could simply disable the log collection. I will look into this (when I'm back from vacation).

ErikBjare commented 6 years ago

Should be fixed in https://github.com/ActivityWatch/aw-qt/pull/25

ErikBjare commented 6 years ago

Was solved in #25, closing.