GothenburgBitFactory / bugwarrior

Pull github, bitbucket, and trac issues into taskwarrior
http://pypi.python.org/pypi/bugwarrior
GNU General Public License v3.0
732 stars 209 forks source link

Relative path name support #871

Closed jonathanabennett closed 2 years ago

jonathanabennett commented 2 years ago

Taskwarrior 2.6.0 has added support for relative pathnames, which is really helpful for those of us wanting to have a unified taskrc for both Mac (installed via homebrew into its own place) and linux. Unfortunately switching to this style of writing our themes crashes bugwarrior.

What I did: With a taskrc written for Taskwarrior 2.6.0 containing the line include green-256.theme, run bugwarrior-pull

What I expected: Bugwarrior to run with no errors

What happened: The following stack trace:

Traceback (most recent call last):
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/bin/bugwarrior-pull", line 8, in <module>
    sys.exit(pull())
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/bugwarrior/command.py", line 73, in pull
    synchronize(issue_generator, config, main_section, dry_run)
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/bugwarrior/db.py", line 335, in synchronize
    tw = TaskWarriorShellout(
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/taskw/warrior.py", line 438, in __init__
    super(TaskWarriorShellout, self).__init__(config_filename)
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/taskw/warrior.py", line 62, in __init__
    self.config = TaskWarriorBase.load_config(config_filename)
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/taskw/warrior.py", line 180, in load_config
    return TaskRc(config_filename, overrides=overrides)
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/taskw/taskrc.py", line 58, in __init__
    config = self._read(self.path)
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/taskw/taskrc.py", line 106, in _read
    TaskRc(right.strip())
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/taskw/taskrc.py", line 58, in __init__
    config = self._read(self.path)
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/site-packages/taskw/taskrc.py", line 96, in _read
    with codecs.open(path, 'r', 'utf8') as config_file:
  File "/Users/jonathan.bennett/.pyenv/versions/3.9.6/lib/python3.9/codecs.py", line 905, in open
    file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: 'dark-green-256.theme'
jonathanabennett commented 2 years ago

Here is the link to the release notes about relative path names: https://github.com/GothenburgBitFactory/taskwarrior/blob/e60fdafdaa461250d9a82ecfb20251473ba8c676/NEWS#L27

ryneeverett commented 2 years ago

This needs to be fixed in taskw. An issue is already open (ralphbean/taskw#150) and a patch has been proposed (ralphbean/taskw#151).