Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #384. #385

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions korman/exporter/outfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,6 @@ def generate_dat_file(self, filename, **kwargs):
except:
raise
else:
# Must call the EncryptedStream close to actually encrypt the data
stream.close()
if not stream is backing_stream:
backing_stream.close()

# Not passing enc as a keyword argument to the output file definition. It makes more
# sense to yield an encrypted stream from this context manager and encrypt as we go
# instead of doing lots of buffer copying to encrypt as a post step.
Expand All @@ -286,6 +281,12 @@ def generate_dat_file(self, filename, **kwargs):
else:
kwargs["file_path"] = file_path
self._files.add(_OutputFile(**kwargs))
finally:
# Must call the EncryptedStream close to actually encrypt the data
if isinstance(stream, plEncryptedStream):
stream.close()
if isinstance(backing_stream, hsFileStream):
backing_stream.close()

def _generate_files(self, func=None):
dat_only = self._exporter().dat_only
Expand Down