-
Notifications
You must be signed in to change notification settings - Fork 421
Using X509Store's set_time function raises an ValueError exception on Windows #798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report. I'm not sure how |
…%s' option and getting the date in a more robust way
Actually, I don't know if it is possible to recreate exactly the >>> from datetime import datetime
>>> from os import putenv
>>> putenv("TZ", "CET")
>>> dt1=datetime(2020, 10, 25, 1, 59, 59) # 1 second before the summer-winter fold
>>> dt2=datetime(2020, 10, 25, 2, 00, 00) # first second in the summer-winter fold
>>> dt3=datetime(2020, 10, 25, 3, 00, 00) # first second after the summer-winter fold
>>> dt1.strftime("%s")
'1603583999'
>>> dt2.strftime("%s")
'1603584000'
>>> dt3.strftime("%s")
'1603591200'
>>> dt2.strftime("%s")
'1603587600' # Yes, it's dt2 again, but the timestamp depends on the previous call to strftime... |
* Fixing issue #798, thanks to @reaperhulk; removing undocumented '%s' option and getting the date in a more robust way Co-authored-by: Joseba Alberdi <[email protected]> Co-authored-by: Alex Gaynor <[email protected]>
Hi there,
when trying to use
X509Store
'sset_time()
function I get an exception on my Windows machine:According to this Stackoverflow post, using
strftime('%s')
on a Pythondatetime.datetime
object is a rather bad idea: https://stackoverflow.com/a/41811725The
%s
directive also is not included in Python'sstrftime()
documentation, however for some reason it still works on Unix based systems: https://docs.python.org/3.7/library/datetime.html#strftime-strptime-behaviorBest regards,
Patrick
The text was updated successfully, but these errors were encountered: