-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Open
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
This code cannot run correctly:
cpython/Lib/test/datetimetester.py
Lines 6221 to 6227 in 55402d3
| def nondst_folds(self): | |
| """Find all folds with the same value of isdst on both sides of the transition.""" | |
| for (_, prev_ti), (t, ti) in pairs(zip(self.ut, self.ti)): | |
| shift = ti[0] - prev_ti[0] | |
| if shift < ZERO and ti[1] == prev_ti[1]: | |
| yield _utcfromtimestamp(datetime, t,), -shift, prev_ti[2], ti[2] | |
Because _utcfromtimestamp is not defined anywhere.
Introduced in 38dc3f2 by @pganssle
I think that this is a typo, I will send a PR.
This was introduced when datetime.utcfromtimestamp was deprecated, I propose to use a direct alternative: datetime.fromtimestamp(t, datetime.UTC)
This problem is not detected by tests, because this looks like a in-test helper for module maintainers. It is not used as of right now.
Linked PRs
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
No status