[issue13847] Catch time(), ftime(), localtime() and clock() errors

STINNER Victor report at bugs.python.org
Fri Jan 27 00:44:17 CET 2012


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

I added tests on localtime() and clock().

I read more carefully time(), ftime() and gettimeofday() manpage: it is not possible that they fail if the argument is an invalid pointer, the current code is correct.

I don't want to backport changes because they are incompatible.

--

There is a failure on FreeBSD 8.2:


======================================================================
FAIL: test_localtime_failure (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/test_time.py", line 358, in test_localtime_failure
    self.assertRaises(OSError, time.localtime, invalid_time_t)
AssertionError: OSError not raised by localtime

http://www.python.org/dev/buildbot/all/builders/AMD64%20FreeBSD%208.2%203.x/builds/1746/steps/test/logs/stdio

test_localtime_failure() should be removed or at least skipped on FreeBSD, except if someone knows another invalid time_t value on this platform.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13847>
_______________________________________


More information about the Python-bugs-list mailing list