ActivityWatch / aw-qt

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

Crashes when pressing "Open Log Folder" #18

Closed johan-bjareholt closed 7 years ago

johan-bjareholt commented 7 years ago
Traceback (most recent call last):
  File "/home/johan/Programming/activitywatch/aw-qt/aw_qt/trayicon.py", line 78, in <lambda>
    menu.addAction("Open log folder", lambda: open_dir(aw_core.dirs.get_log_dir()))
  File "/home/johan/Programming/activitywatch/aw-core/aw_core/dirs.py", line 10, in wrapper
    path = f(*args, **kwargs)
TypeError: get_log_dir() missing 1 required positional argument: 'module_name'
zsh: abort (core dumped)  aw-qt
ErikBjare commented 7 years ago

Should probably make it accept None as a valid module_name for when we want to get the root log folder.

Also, this bug could probably be found by mypy ahead of runtime.

Edit: mypy wouldn't actually be able to typecheck it due to our use of the ensure_returned_path_exists decorator and mypy's limited support for decorators: https://github.com/python/mypy/issues/3157

Edit 2: Actually managed to fix it by making the decorator typing more strict.

ErikBjare commented 7 years ago

The support for None as a module_name is added in https://github.com/ActivityWatch/aw-core/pull/40