Skip to content

Commit

Permalink
Add explanatory comments for why file is being closed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Ferrier committed Mar 3, 2017
1 parent 9be1da4 commit 6d17757
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions email2pdf
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ def add_update_pdf_metadata(filename, update_dictionary):
info_dict.update({NameObject(key): createStringObject(full_update_dictionary[key])})

os_file_out, temp_file_name = tempfile.mkstemp(prefix="email2pdf_add_update_pdf_metadata", suffix=".pdf")
# Immediately close the file as created to work around issue on
# Windows where file cannot be opened twice.
os.close(os_file_out)

with open(temp_file_name, 'wb') as file_out:
Expand Down

0 comments on commit 6d17757

Please sign in to comment.