Commit 2ca8e36
fix: catch ValueError in _to_utc_date_string for year-1 datetimes
astimezone(utc_tz) on a naive datetime near year 1 can raise ValueError
("year must be in 1..9999, not 0") when the local timezone offset shifts
the date before year 1, not only OverflowError/OSError as previously assumed.
Fixes tests TestErrorUnitTestBot::test_to_utc_date_string_with_exception
and TestRegressionUnitTestBot::test_to_utc_date_string_min broken by e9a053a.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 62c37a7 commit 2ca8e36
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments