Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closed: #1135
Purpose of the pull request
As title
Related: #1168 fixes the separate temp-file leak on the same path (#1137).
What's changed?
OutputStream: whendoOutputStreamEncrypt07()fails,finish()setswriteExcel = false, so the unencrypted workbook is no longer written to the caller's stream.File: whendoFileEncrypt07()fails,finish()deletes the target file.finish()rather than thrown on the spot, so the remaining cleanup still runs.Tests
xlsxStreamPasswordWrite_encryptionFails_writesNothing: the temp directory path runs through a regular file, so it cannot be created. Asserts the caller's stream is empty; onmainit holds the full unencrypted workbook.xlsxFilePasswordWrite_encryptionFails_leavesNoFile: the target is made read-only after its output stream is open, so encrypting it in place fails. Asserts the file no longer exists; onmainit is left as a plain xlsx. Skipped where file permissions are not enforced (root).This conflicts with #1168 only at the end of
EncryptDataTest, where both add tests. I'll rebase whichever lands second; after #1168 is merged, the stream test here can use itswriteWithPasswordhelper.Checklist