[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!




http://bugs.python.org/review/19940/diff/11142/Doc/library/ssl.rst
File Doc/library/ssl.rst (right):

http://bugs.python.org/review/19940/diff/11142/Doc/library/ssl.rst#newcode379
Doc/library/ssl.rst:379: "notBefore" or "notAfter" dates must use GMT
(:rfc:`3280`).
It seems RFC 3280 was superseded by RFC 5280?

http://bugs.python.org/review/19940/diff/11142/Lib/test/test_ssl.py
File Lib/test/test_ssl.py (right):

http://bugs.python.org/review/19940/diff/11142/Lib/test/test_ssl.py#newcode654
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.

http://bugs.python.org/review/19940/diff/11142/Lib/test/test_ssl.py#newcode656
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?

http://bugs.python.org/review/19940/diff/11142/Lib/test/test_ssl.py#newcode659
Lib/test/test_ssl.py:659: def bad(self, timestring):
Same here.

http://bugs.python.org/review/19940/diff/11142/Lib/test/test_ssl.py#newcode663
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)

http://bugs.python.org/review/19940/diff/11142/Lib/test/test_ssl.py#newcode705
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.

http://bugs.python.org/review/19940/


More information about the docs mailing list