You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a blf file with a start_timestamp like: 1636485425.999908, then read with BLFReader, the start_timestamp cannot be interpreted and assigned to 0.
To Reproduce
Try to save a blf file with start_timestamp like 1636485425.999908. then read it with BLFReader.
The error is caused by the following(function systemtime_to_timestamp()) :
1636485425.999908 will become (2021, 11, 2, 9, 20, 17, 5, 1000). The microsecond part becomes 1000.
When read with BLFReader(function: timestamp_to_systemtime()):
Describe the bug
Write a blf file with a start_timestamp like: 1636485425.999908, then read with BLFReader, the start_timestamp cannot be interpreted and assigned to 0.
To Reproduce
Try to save a blf file with start_timestamp like 1636485425.999908. then read it with BLFReader.
The error is caused by the following(function systemtime_to_timestamp()) :
1636485425.999908 will become (2021, 11, 2, 9, 20, 17, 5, 1000). The microsecond part becomes 1000.
When read with BLFReader(function: timestamp_to_systemtime()):
An error with the microsecond part: systemtime[7] * 1000 is 1000000 over a valid range 0-99999. The start_timestamp will be 0. Information lost.
Suggest: dont round(t.microsecond/1000), instead use: t.microsecond//1000, to keep the first 3 digits.
Expected behavior
Keep the original timestamp.
Additional context
OS and version: Win10
Python version: 3.9.7
python-can version: 4.0.0
python-can interface/s (if applicable):
Traceback and logs
The text was updated successfully, but these errors were encountered: