Status: New
Owner: ----
Labels: Type-Patch
New issue 1269 by [email protected]: Patch for
/src/robot/utils/robottime.py
http://code.google.com/p/robotframework/issues/detail?id=1269
It seems that my code suggestion [1] does contain a bug and the Python
documentation was misleading for my eyes.
The try and fail method reveals, at least for me, that the time.altzone
returns always the DST offset from the UTC. It does not take account is the
DST actually used or not.
For quick reading the Python docs [2], the time.timezone returns the UTC
offset and time.altzone returns DST offset. In Finland these are: -7200 and
-10800.
Is the DST used or not, can be revealed by the function time.localtime
return time.struct_time index 8.
The following patch tries to fix the problem, but of course this breaks the
acceptance test, because it also rely on the time.altzone. Again the patch
looks like a ugly hack but if the general idea is accepted, I can fix the
acceptance tests.
-Tatu
[1] http://code.google.com/p/robotframework/issues/detail?id=1233
[2] http://docs.python.org/2/library/time.htm
Attachments:
robottime.py.patch 424 bytes