1
0
Fork 1
mirror of https://github.com/andrewferrier/email2pdf.git synced 2025-03-16 21:23:37 +00:00

Add explanatory comments for why file is being closed.

This commit is contained in:
Andrew Ferrier 2017-03-03 12:05:27 +08:00
parent 9be1da4c2b
commit 6d17757432

View file

@ -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: