mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Merged revisions 75011 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75011 | brett.cannon | 2009-09-21 17:29:48 -0700 (Mon, 21 Sep 2009) | 10 lines When range checking was added to time.strftime() a check was placed on tm_isdst to make sure it fell within [-1, 1] just in case someone implementing strftime() in libc was stupid enough to assume this. Turns out, though, some OSs (e.g. zOS) are stupid enough to use values outside of this range for time structs created by the system itself. So instead of throwing a ValueError, tm_isdst is now normalized before being passed to strftime(). Fixes issue #6823. Thanks Robert Shapiro for diagnosing the problem and contributing an initial patch. ........
This commit is contained in:
parent
ca767bd2db
commit
7d12c559ce
3 changed files with 8 additions and 10 deletions
|
@ -87,11 +87,6 @@ class TimeTestCase(unittest.TestCase):
|
|||
(1900, 1, 1, 0, 0, 0, 0, -1, -1))
|
||||
self.assertRaises(ValueError, time.strftime, '',
|
||||
(1900, 1, 1, 0, 0, 0, 0, 367, -1))
|
||||
# Check daylight savings flag [-1, 1]
|
||||
self.assertRaises(ValueError, time.strftime, '',
|
||||
(1900, 1, 1, 0, 0, 0, 0, 1, -2))
|
||||
self.assertRaises(ValueError, time.strftime, '',
|
||||
(1900, 1, 1, 0, 0, 0, 0, 1, 2))
|
||||
|
||||
def test_default_values_for_zero(self):
|
||||
# Make sure that using all zeros uses the proper default values.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue