[Python-checkins] python/dist/src/Modules timemodule.c,2.129,2.130

Fred L. Drake, Jr. fdrake@acm.org
Fri, 19 Jul 2002 13:32:52 -0400


Barry A. Warsaw writes:
 > I don't think test_time.py actually tests this parameter, but
 > test_email.py which is what's failing for me:

I see this as well, but test_time.py subsequently fails as well.
Interestingly, test_strptime.py passes.

grendel(.../trunk/release); ./python ../Lib/test/test_time.py
test_asctime (__main__.TimeTestCase) ... ok
test_clock (__main__.TimeTestCase) ... ok
test_conversions (__main__.TimeTestCase) ... ok
test_data_attributes (__main__.TimeTestCase) ... ERROR
test_sleep (__main__.TimeTestCase) ... ok
test_strftime (__main__.TimeTestCase) ... ok
test_strptime (__main__.TimeTestCase) ... ERROR

======================================================================
ERROR: test_data_attributes (__main__.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "../Lib/test/test_time.py", line 12, in test_data_attributes
    time.altzone
AttributeError: 'module' object has no attribute 'altzone'

======================================================================
ERROR: test_strptime (__main__.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "../Lib/test/test_time.py", line 47, in test_strptime
    time.strptime(time.strftime(format, tt), format)
  File "/home/fdrake/projects/python/trunk/Lib/_strptime.py", line 389, in strptime
    compiled_re = TimeRE(locale_time).compile(format)
  File "/home/fdrake/projects/python/trunk/Lib/_strptime.py", line 369, in compile
    return re_compile(self.pattern(format), IGNORECASE)
  File "/home/fdrake/projects/python/trunk/Lib/_strptime.py", line 360, in pattern
    processed_format = "%s%s%s" % (processed_format,
  File "/home/fdrake/projects/python/trunk/Lib/_strptime.py", line 314, in __getitem__
    self[fetch] = self.pattern(self.locale_time.LC_date_time)
  File "/home/fdrake/projects/python/trunk/Lib/_strptime.py", line 157, in __get_LC_date_time
    if not self.__LC_date_time: self.__calc_date_time()
  File "/home/fdrake/projects/python/trunk/Lib/_strptime.py", line 234, in __calc_date_time
    current_format = current_format.replace(self.timezone[0], '%Z')
  File "/home/fdrake/projects/python/trunk/Lib/_strptime.py", line 149, in __get_timezone
    if not self.__timezone: self.__calc_timezone()
  File "/home/fdrake/projects/python/trunk/Lib/_strptime.py", line 263, in __calc_timezone
    self.__timezone = self.__pad(time.tzname, 0)
AttributeError: 'module' object has no attribute 'tzname'

----------------------------------------------------------------------
Ran 7 tests in 1.276s

FAILED (errors=2)
Traceback (most recent call last):
  File "../Lib/test/test_time.py", line 62, in ?
    test_main()
  File "../Lib/test/test_time.py", line 58, in test_main
    test_support.run_unittest(TimeTestCase)
  File "../Lib/test/test_support.py", line 190, in run_unittest
    run_suite(unittest.makeSuite(testclass), testclass)
  File "../Lib/test/test_support.py", line 184, in run_suite
    raise TestFailed(msg)
test_support.TestFailed: errors occurred in __main__.TimeTestCase


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation