syncall icon indicating copy to clipboard operation
syncall copied to clipboard

[BUG] FileNotFoundError: Notion sync fails with error reading taskrc file.

Open csgcode opened this issue 3 years ago • 1 comments

Describe the bug

tw_notion_sync fails with FileNotFoundError, Apparently due to not being able to read the configuration file appropriately.

I installed the application and tried to sync with a page in Notion. The only changes done to .taskrc is I have applied a theme.

To Reproduce

Steps to reproduce the behaviour:

  1. Install and try using tw_notion_sync with a modified .taskrc (I have a theme applied)

Expected Behavior

Sync should work fine.

📸 Screenshots

Logs:

Traceback (most recent call last):
  File "/xxxxxx/code/venvs/task-sync/bin/tw_notion_sync", line 8, in <module>
    sys.exit(main())
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/taskwarrior_syncall/scripts/tw_notion_sync.py", line 157, in main
    tw_side = TaskWarriorSide(tags=tw_tags, project=tw_project)
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/taskwarrior_syncall/taskwarrior_side.py", line 53, in __init__
    self._tw = TaskWarrior(marshal=True, config_filename=config_file)
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/taskw/warrior.py", line 438, in __init__
    super(TaskWarriorShellout, self).__init__(config_filename)
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/taskw/warrior.py", line 62, in __init__
    self.config = TaskWarriorBase.load_config(config_filename)
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/taskw/warrior.py", line 180, in load_config
    return TaskRc(config_filename, overrides=overrides)
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/taskw/taskrc.py", line 58, in __init__
    config = self._read(self.path)
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/taskw/taskrc.py", line 106, in _read
    TaskRc(right.strip())
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/taskw/taskrc.py", line 58, in __init__
    config = self._read(self.path)
  File "/xxxxxx/code/venvs/task-sync/lib/python3.9/site-packages/taskw/taskrc.py", line 96, in _read
    with codecs.open(path, 'r', 'utf8') as config_file:
  File "/usr/local/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/codecs.py", line 905, in open
    file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: 'dark-yellow-green.theme'

Versions

OS Version (cat /etc/*-release; uname -a)

Darwin MacBook-Pro.local 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64 x86_64

Python version (python --version; python3 --version)

Python 3.9.13

--version of your executable

tw_notion_sync, version 1.2.1

Additional context

Add any other context about the problem here.

csgcode avatar Sep 17 '22 13:09 csgcode

Just realized that this might be an issue with taskw. Will update the details.

csgcode avatar Sep 17 '22 13:09 csgcode

Hi @csgcode , sorry for the late reply.

Correct, this is an issue with taskw and it's a duplicate of https://github.com/bergercookie/syncall/issues/57. Feel free to open an issue with taskw instead :)

bergercookie avatar Jan 19 '23 14:01 bergercookie

Pending PR in taskw that fixes this: https://github.com/ralphbean/taskw/pull/151

bergercookie avatar Jan 19 '23 14:01 bergercookie