Open Athanasius opened 2 years ago
We're not expanding ~ for the journal file locking. Pathlib, unfortunately, doesn't do this for you:
~
In [1]: import pathlib In [2]: jd = '~/tmp' In [3]: jdp = pathlib.Path(jd) In [4]: jdp Out[4]: PosixPath('~/tmp') In [5]: jdln = jdp / 'test' In [6]: jdln Out[6]: PosixPath('~/tmp/decode-header.py') In [7]: jdl = open(jdln, 'r') --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) <ipython-input-7-d979539e9e63> in <module> ----> 1 jdl = open(jdln, 'r') FileNotFoundError: [Errno 2] No such file or directory: '~/tmp/test'
Whilst we're at it, do a general pass on anything that could possibly be opening a file from a user-defined location.
We're not expanding
~
for the journal file locking. Pathlib, unfortunately, doesn't do this for you: