Jrnl: Journal templates don't expand user path

Created on 10 Jul 2020  路  2Comments  路  Source: jrnl-org/jrnl

Bug Report

Environment

  • Jrnl version:
  • Install method:
  • OS
    Likely all versions.

Current Behavior


~/template.md doesn't work for a template file. Has this error:
[Could not read template at '~/template.md']

Expected Behavior


The ~ should be expanded the same way it is for journal file themselves.

Repro Steps

Other Information


Current workaround is to use the full path to a file (e.g. /Users/wren/template.md) instead.

bug

Most helpful comment

704 solved a similar problem in the upgrade script.

The added code was:

path = os.path.expanduser(path)

All 2 comments

There might be other instances of this behavior throughout the code, so the fix for this should include a simple function to handle properly expanding paths, and change all instances in the codebase to use this new function.

704 solved a similar problem in the upgrade script.

The added code was:

path = os.path.expanduser(path)
Was this page helpful?
0 / 5 - 0 ratings