Closed GoogleCodeExporter closed 8 years ago
Those are indeed real test failures and not something at your end. See also
http://bel-epa.com/hudson/job/rdflib/22/testReport/.
A fix for the parse_date_time doctest failure has proved elusive, mainly
because the failure has proved impossible to reproduce outside the UK.
HTH
Original comment by gjhigg...@gmail.com
on 16 Sep 2011 at 12:36
Now fixed, see http://bel-epa.com/hudson/job/rdflib/
Original comment by gjhigg...@gmail.com
on 20 Sep 2011 at 5:30
Most bugs are fixed. I still get the parse_date_time error ... I'll see if I
can track it down.
Original comment by gk-goo...@ninebynine.org
on 21 Sep 2011 at 12:44
I managed to fix the date_time doctest in my working copy. It seems to be
daylight savings time related (maybe timezone related?) so I can't be sure if
it works in all timezones as intended.
Refs:
http://docs.python.org/library/time.html#time.mktime (and table of conversion
functions on same page)
http://docs.python.org/library/calendar.html#calendar.timegm
A patch (which does not delete any original code, but overwrites the result, is:
[[
# HG changeset patch
# User Graham Klyne <gk-google@ninebynine.org>
# Date 1316634766 -3600
# Node ID 98a2ae400c4bbcc8475339906450b0691c1e98f4
# Parent 0432070a728a216cf6c76d0c11e231397d4b4fd7
Use calendar.timegm instead of time.mktime to avoid DST problem
diff -r 0432070a728a -r 98a2ae400c4b rdflib/util.py
--- a/rdflib/util.py Tue Sep 20 18:15:54 2011 +0100
+++ b/rdflib/util.py Wed Sep 21 20:52:46 2011 +0100
@@ -60,6 +60,7 @@
from time import mktime, time, gmtime, localtime, timezone, altzone, daylight
+from calendar import timegm
def date_time(t=None, local_time_zone=False):
"""http://www.w3.org/TR/NOTE-datetime ex: 1997-07-16T19:20:30Z
@@ -135,6 +136,10 @@
t = mktime((int(year), int(month), int(day), int(hour),
int(minute), int(second), 0, 0, 0))
t = t - timezone + tz_offset
+ # Alternative handles case when local time is DST
+ t = timegm((int(year), int(month), int(day), int(hour),
+ int(minute), int(second), 0, 0, 0))
+ t = t + tz_offset
return t
def from_n3(s, default=None, backend=None):
]]
Original comment by gk-goo...@ninebynine.org
on 21 Sep 2011 at 8:04
Original issue reported on code.google.com by
gk-goo...@ninebynine.org
on 12 Sep 2011 at 9:43Attachments: