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
I am encountering an issue with the FileLock when trying to use it in a timezone different than UTC.
The _expiry_time call throws the exception: ValueError: year 10000 is out of range
when computing datetime.datetime.max.astimezone(datetime.timezone.utc)
As far as I understand, internally, datetime does this:
timestamp() method actually converts your datetime in local timezone. If your timezone is UTC+x (not UTC-x); i.e. your timezone is ahead of UTC time; Then it will add more time in your datetime object (datetime.datetime.max), which will cross the time beyond the year 9999.
But this is a weird behavior in datetime. Anyway, is it possible to have a way to use sherlock on timezones different than UTC(UTC + x)?
I can work on this, if it looks like a valid problem.
One possible fix is to use
Hello,
Thank you for the awesome library.
I am encountering an issue with the
FileLock
when trying to use it in a timezone different than UTC.The
_expiry_time
call throws the exception:ValueError: year 10000 is out of range
when computing
datetime.datetime.max.astimezone(datetime.timezone.utc)
As far as I understand, internally,
datetime
does this:But this is a weird behavior in
datetime
. Anyway, is it possible to have a way to usesherlock
on timezones different than UTC(UTC + x)?I can work on this, if it looks like a valid problem.
One possible fix is to use
Python 3.10.9
OS: LinuxMint 21.1
The text was updated successfully, but these errors were encountered: