test suite for iso_strptime fails

Bug #344166 reported by Martin Pitt on 2009-03-17
2
Affects Status Importance Assigned to Milestone
wadllib
High
Unassigned
python-wadllib (Ubuntu)
Undecided
Martin Pitt

Bug Description

If I try to build r7 of wadllib on current Jaunty, the test suite (and thus the build) fails:

Doctest: wadllib.txt ... ok
Doctest: wadllib.iso_strptime ... FAIL

======================================================================
FAIL: Doctest: wadllib.iso_strptime
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/doctest.py", line 2145, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for wadllib.iso_strptime
  File "/home/martin/ubuntu/tmp/python-wadllib-0.1~bzr7/wadllib/iso_strptime.py", line 17, in iso_strptime

----------------------------------------------------------------------
File "/home/martin/ubuntu/tmp/python-wadllib-0.1~bzr7/wadllib/iso_strptime.py", line 25, in wadllib.iso_strptime
Failed example:
    d.timetuple()
Expected:
    (2008, 1, 7, 5, 30, 30, 0, 7, 0)
Got:
    time.struct_time(tm_year=2008, tm_mon=1, tm_mday=7, tm_hour=5, tm_min=30, tm_sec=30, tm_wday=0, tm_yday=7, tm_isdst=0)
----------------------------------------------------------------------
File "/home/martin/ubuntu/tmp/python-wadllib-0.1~bzr7/wadllib/iso_strptime.py", line 27, in wadllib.iso_strptime
Failed example:
    d.utctimetuple()
Expected:
    (2008, 1, 7, 2, 30, 30, 0, 7, 0)
Got:
    time.struct_time(tm_year=2008, tm_mon=1, tm_mday=7, tm_hour=2, tm_min=30, tm_sec=30, tm_wday=0, tm_yday=7, tm_isdst=0)

----------------------------------------------------------------------
Ran 2 tests in 0.513s

That smells like another Python 2.6 change?

Martin Pitt (pitti) wrote :

$ python2.6 -c 'import datetime; print datetime.datetime(2008, 1, 7, 5, 30, 30, 345323).timetuple()'
time.struct_time(tm_year=2008, tm_mon=1, tm_mday=7, tm_hour=5, tm_min=30, tm_sec=30, tm_wday=0, tm_yday=7, tm_isdst=-1)

$ python2.5 -c 'import datetime; print datetime.datetime(2008, 1, 7, 5, 30, 30, 345323).timetuple()'
(2008, 1, 7, 5, 30, 30, 0, 7, -1)

Martin Pitt (pitti) wrote :

So it's both <type 'time.struct_time'>, but it seems the str() of that changed in python2.6.

Martin Pitt (pitti) on 2009-03-17
Changed in python-wadllib (Ubuntu):
assignee: nobody → pitti
status: New → In Progress
Martin Pitt (pitti) wrote :

With this patch, the testsuite works for both 2.5 and 2.6.

Changed in wadllib:
status: New → Confirmed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-wadllib - 0.1~bzr7-0ubuntu4

---------------
python-wadllib (0.1~bzr7-0ubuntu4) jaunty; urgency=low

  * debian/control: Bump python-nose build dependency to >= 0.10.4, which is
    compatible with Python 2.6. (See LP #337585)
  * debian/rules: Enable the test suite again.
  * wadllib/iso_strptime.py: Fix datetime tuple output comparison to also work
    with Python 2.6. (LP: #344166)

 -- Martin Pitt <email address hidden> Tue, 17 Mar 2009 11:38:30 +0100

Changed in python-wadllib:
status: In Progress → Fix Released
Changed in wadllib:
status: Confirmed → Triaged
importance: Undecided → High
tags: added: patch trivial
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Patches