[docs] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC (issue 19940)

pitrou at free.fr pitrou at free.fr
Thu Feb 27 20:44:43 CET 2014

Here are a couple comments on the patch.
Since those are mostly cosmetic, I'll fix them myself if you don't want
to provide another patch.

Thank you!

File Doc/library/ssl.rst (right):

Doc/library/ssl.rst:379: "notBefore" or "notAfter" dates must use GMT
It seems RFC 3280 was superseded by RFC 5280?

File Lib/test/test_ssl.py (right):

Lib/test/test_ssl.py:654: class UtilityTests(unittest.TestCase):
The tests can go in BasicSocketTests, which already has many tests for
module-level utilities.

Lib/test/test_ssl.py:656: def good(self, timestring, timestamp):
As a matter of naming, I would prefer something more explicit than
"good". "cert_time_ok" perhaps?

Lib/test/test_ssl.py:659: def bad(self, timestring):
Same here.

Lib/test/test_ssl.py:663: @unittest.skipUnless(utc_offset(),
I don't understand the skip. The test will work even if the local time
is UTC.
(be assured that most computers running the tests, even our buildbots,
won't be set on an UTC timezone anyway)

Lib/test/test_ssl.py:705: locale.setlocale(locale.LC_TIME, 'pl_PL.utf8')
To maximize chances that the test is run, you could simply set the
locale to locale.getdefaultlocale().
Below, you can use the result of `time.strftime('%b %d %H:%M:%S %Y
GMT')` instead of the hardcoded Polish time string.


More information about the docs mailing list