Skip to content

fix: handle None timezone_offset in timestamp formatting - #208

Open
saschabuehrle wants to merge 1 commit into
KnugiHK:devfrom
saschabuehrle:fix/issue-205-timezone-none
Open

fix: handle None timezone_offset in timestamp formatting#208
saschabuehrle wants to merge 1 commit into
KnugiHK:devfrom
saschabuehrle:fix/issue-205-timezone-none

Conversation

@saschabuehrle

Copy link
Copy Markdown

Fixes #205

Timing.format_timestamp() accepted Optional[int] for timezone_offset, but it always instantiated TimeZone(self.timezone_offset). When the offset was None, this crashed in timedelta(hours=None).

This keeps the existing timezone path for integer offsets and uses plain datetime.fromtimestamp() when offset is None. Added a regression test for the None case.

Greetings, saschabuehrle

@KnugiHK

KnugiHK commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Hi, just checking, did the fix in #206 not solve it on your end? Happy to dig back into it if it's still acting up.

@KnugiHK
KnugiHK changed the base branch from main to dev April 2, 2026 13:04
@saschabuehrle

Copy link
Copy Markdown
Author

Yeah, #206 fixes one path, but this PR covers another failing case where timezone_offset can still be None in imports. I hit that on a converted export and this guard prevents the timedelta(None) crash there too.\n\nGreetings, saschabuehrle

@KnugiHK

KnugiHK commented Apr 14, 2026

Copy link
Copy Markdown
Owner

I ran your test_timing.py against the current dev branch and it's passing, likely because the None guard we added in #206 to Timing.__init__ effectively handles this. Could you double-check if you are still seeing failures on the latest dev branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: crash in timestamp formatting when timezone_offset is none

2 participants