Skip to content

Commit

Permalink
Fix to use working path for html temp space.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Littman committed Dec 7, 2016
1 parent 11d6787 commit 4c5a2ac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sfmutils/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,12 @@ def on_message(self):
self._send_response_message(STATUS_SUCCESS if self.result.success else STATUS_FAILURE, self.routing_key,
export_id, self.result)

@staticmethod
def _file_fix(filepath, prefix=None, suffix=None):
def _file_fix(self, filepath, prefix=None, suffix=None):
"""
create a temp file to save the large file object, don't
need to load file to memory
"""
with tempfile.NamedTemporaryFile(dir='.', delete=False) as outfile:
with tempfile.NamedTemporaryFile(dir=self.working_path, delete=False) as outfile:
if prefix:
outfile.write(prefix)
shutil.copyfileobj(file(filepath, 'r'), outfile)
Expand Down

0 comments on commit 4c5a2ac

Please sign in to comment.