Message205860
gudge,
There is also an issue with the current strptime format [1] (`"%b %d %H:%M:%S %Y GMT"`). It is locale-dependent and it may fail if a non-English locale is in effect. I don't know whether I should open a new issue on this or are you going to fix it too.
`cert_time_to_seconds()` is documented [2] to parse notBefore, notAfter fields from a certificate. As far as I can tell they do not depend on current locale. Thus the following code should not fail:
>>> timestr = "May 9 00:00:00 2007 GMT"
>>> import ssl
>>> ssl.cert_time_to_seconds(timestr)
1178661600.0
>>> import locale
>>> locale.setlocale(locale.LC_TIME, 'pl_PL.utf8')
'pl_PL.utf8'
>>> ssl.cert_time_to_seconds(timestr)
Traceback (most recent call last):
...[snip]...
ValueError: time data 'May 9 00:00:00 2007 GMT' does not match format '%b %d %H:%M:%S %Y GMT'
[1]: http://hg.python.org/cpython/file/96a68e369d13/Lib/ssl.py#l849
[2]: http://hg.python.org/cpython/file/96a68e369d13/Doc/library/ssl.rst#l359 |
|
Date |
User |
Action |
Args |
2013-12-10 21:37:28 | akira | set | recipients:
+ akira, janssen, pitrou, christian.heimes, docs@python, gudge |
2013-12-10 21:37:28 | akira | set | messageid: <1386711448.65.0.591865932318.issue19940@psf.upfronthosting.co.za> |
2013-12-10 21:37:28 | akira | link | issue19940 messages |
2013-12-10 21:37:28 | akira | create | |
|