Issue1671562

classification
Title: test_datetime is locale dependent
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, pekka.klarck
Priority: normal Keywords:

Created on 2007-03-01.10:22:53 by pekka.klarck, last changed 2007-04-23.05:31:56 by cgroves.

Messages
msg1523 (view) Author: Pekka Klärck (pekka.klarck) Date: 2007-03-01.10:22:53
When running Lib/test/regrtest.py I got following failures from test_datetime. 'pe maalis 22 18:03:05 2002' is correct in Finnish locale so probably only the test is buggy.


test_datetime
........................................................................F.......
................................................................................
F.................................
======================================================================
FAIL: test_more_ctime (test_datetime.TestDateTime)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "d:\workspace\jython\dist\lib\unittest.py", line 213, in __call__
    testMethod()
  File "d:\workspace\jython\dist\lib\test\test_datetime.py", line 1052, in test_
more_ctime
    self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
  File "d:\workspace\jython\dist\lib\unittest.py", line 286, in failUnlessEqual
    raise self.failureException, \
AssertionError: 'Fri Mar 22 18:03:05 2002' != 'pe maalis 22 18:03:05 2002'

======================================================================
FAIL: test_more_ctime (test_datetime.TestDateTimeTZ)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "d:\workspace\jython\dist\lib\unittest.py", line 213, in __call__
    testMethod()
  File "d:\workspace\jython\dist\lib\test\test_datetime.py", line 1052, in test_
more_ctime
    self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
  File "d:\workspace\jython\dist\lib\unittest.py", line 286, in failUnlessEqual
    raise self.failureException, \
AssertionError: 'Fri Mar 22 18:03:05 2002' != 'pe maalis 22 18:03:05 2002'

----------------------------------------------------------------------
Ran 194 tests in 6.610s

FAILED (failures=2)
msg1524 (view) Author: Charlie Groves (cgroves) Date: 2007-04-23.05:31:56
The test was actually correct.  time.ctime and time.asctime aren't supposed to be locale aware, but Jython was using the default locale's time strings.  Fixed in r3183.
History
Date User Action Args
2007-03-01 10:22:53pekka.klarckcreate