Skip to content

Commit

Permalink
fix creation of invalid import directory
Browse files Browse the repository at this point in the history
  • Loading branch information
alee committed Sep 29, 2016
1 parent 789ff5c commit 2dbb6b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions catalog/citation/management/commands/load_bibtex.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ... import bibtex as bibtex_api

import logging
import os
import pathlib
import pickle

Expand Down Expand Up @@ -43,6 +44,7 @@ def process_bibtex_file(self, path, user):
logger.debug("deleting old invalid_output_file file %s", invalid_output_file)
invalid_output_file.unlink()
errors_and_duplicates = bibtex_api.process_entries(path.absolute().as_posix(), user)
os.makedirs(str(invalid_output_file.parent.absolute()), exist_ok=True)
with invalid_output_file.open('wb') as f:
logger.debug("Pickling duplicate errors to %s", invalid_output_file)
pickle.dump(errors_and_duplicates, f)
Expand Down

0 comments on commit 2dbb6b3

Please sign in to comment.