Skip to content

Commit

Permalink
Merge pull request inspirehep#2374 from jacquerie/integrate-pr-2372
Browse files Browse the repository at this point in the history
workflows: fix arxiv_plot_extract
  • Loading branch information
jacquerie authored May 23, 2017
2 parents 0208ed2 + e166d03 commit 1427bc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inspirehep/modules/workflows/tasks/arxiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import backoff
from flask import current_app
from lxml.etree import XMLSyntaxError
from six import BytesIO
from wand.exceptions import DelegateError
from werkzeug import secure_filename

Expand Down Expand Up @@ -131,7 +130,8 @@ def arxiv_plot_extract(obj, eng):
return

for idx, plot in enumerate(plots):
obj.files[plot.get('name')] = BytesIO(open(plot.get('url')))
with open(plot.get('url')) as plot_file:
obj.files[plot.get('name')] = plot_file
obj.files[plot.get('name')]['description'] = u'{0:05d} {1}'.format(
idx, ''.join(plot.get('captions', []))
)
Expand Down

0 comments on commit 1427bc0

Please sign in to comment.