mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #892] is_token_expired buggy on non-UTC system #542
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#542
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joeb1415 on GitHub (Nov 23, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/892
Describe the bug
is_token_expired()usestime.time()which returns system local time, which, when running on a non-UTC system, can return incorrectly.Your code
Expected behavior
Replace
time.time()with, e.g.,time.mktime(time.gmtime())wherever used.Environment:
Additional context
Add any other context about the problem here.
@stephanebruckert commented on GitHub (Dec 13, 2022):
Great catch, would love a PR for it if you get a chance!