Skip to content

import fails if pdf not found #2

@pazz

Description

@pazz

I hope It's OK to post bugs here.
I am trying to get a reasonable xapers environment set up once again and there are a few pitfalls that I'm running into. One is a crash due to unavailable files. My bibfile contains an entry with:

File                     = {HT2012.pdf:papers/HT2012.pdf:PDF}

But the file is not available (the entry was copied from an old folder).
Now xapers import publications.bib dies on me halfway through the file

...
HT2012
  Adding file: papers/HT2012.pdf
Traceback (most recent call last):
  File "/usr/bin/xapers", line 11, in <module>
    load_entry_point('xapers==0.8.2', 'console_scripts', 'xapers')()
  File "/usr/lib/python3/dist-packages/xapers/__main__.py", line 221, in main
    cli.importbib(db, bibfile, tags=tags)
  File "/usr/lib/python3/dist-packages/xapers/cli.py", line 350, in importbib
    doc.add_file(filepath)
  File "/usr/lib/python3/dist-packages/xapers/documents.py", line 263, in add_file
    with open(infile, 'br') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'papers/HT2012.pdf'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions