Open
Conversation
jonasbardino
added a commit
that referenced
this pull request
Feb 17, 2026
…459) * Fix a regression in the recent addition of transparent compression in `userio` module. The resulting file in `events_home` would silently fail during writes for the compressed cases due to a subtle bytes vs str issue for gzip and bz2 file handles, when using mode strings without a specific binary or text marker. They default to open in binary mode in that case, which breaks writing of plain strings with an error like: `memoryview: a bytes-like object is required, not 'str'` To make matters worse our old built-in self-tests did not verify the written event files at all, so when they weren't created it looked like things were alright. Adjusted the gzip and bz2 compression cases to explicitly use text mode for regular string writing to address the regression. Reworked the self-tests to include careful verification of the written event files and their contents as a regression test. It was necessary to expose the event timestamps as an optional arg in the function APIs to enable such testing. Also addressed a minor issue with the clean-up helper not fully cleaning up after 'remove' tests, where the data is really moved into the user Trash folder in the root of the user home. Further modern unit tests of the `userio` module are ready in #461.
db2c955 to
bc804d4
Compare
bc804d4 to
fe95c0a
Compare
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.
Fundamental unit tests for the
useriohelpers including regression tests for issue #460 to be enabled along with the fix. Increasing tests coverage is easy now that the basic structure is in place for generating them.