getmtime differs between Py2.5 and Py2.4

Josef Dalcolmo dalcolmo at vh-s.de
Mon May 7 13:26:21 EDT 2007


I tried this on Windows only:

In Python 2.4 os.path.getmtime returned the local time,
in Python 2.5 it seems to return GMT:

import os, time
print ctime.time(os.path.getmtime(foo))

differs on Python 2.4 and Python 2.5 by the timezone.

Now, the implementation of the two stat calls differs on Windows
between the two versions.

I actually like the new behaviour better, because I believe the
reported time of a file should not depend on the timezone or other
local settings, however the old behaviour is the time also Windows
shows - and there is an incompatibility.

Is this a bug? 

- Josef



More information about the Python-list mailing list