Repository navigation
Conversation
Author
|
Hi @zariiii9003, could you take a look at this when you have a moment? Happy to fix up anything that needs changing. Thanks! |
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.
Summary of Changes
BLFReaderandBLFWriteraccept a new optionaltzargument (adatetime.tzinfo), following the existingtzparameter of the ASC reader/writer.systemtime_to_timestampandtimestamp_to_systemtimegained the same optional parameter; their defaults are unchanged.tz, everything keeps assuming UTC.This addresses the compatibility problem from the issue: CANoe writes the header timestamps in the local time of the recording computer, so reading such a file shifted all timestamps unless you happened to be in UTC. Now you can pass e.g.
tz=ZoneInfo("Europe/Berlin")(or the matching fixed offset) on both sides.Related Issues / Pull Requests
Type of Change
Checklist
tox).Additional Notes
Tests: new
TestBlfTimezonein test/logformats_test.py covers the SYSTEMTIME conversion helpers, a write/read round-trip with a timezone (including that reading withouttzshifts the timestamps by exactly the offset), and append mode keeping the start timestamp. Full logformats suite passes (82 passed, 10 skipped);ruff check(project pin) andblack --checkare clean on the changed files.