[ python-Bugs-1565150 ] os.stat() subsecond file mode time is incorrect on Windows
SourceForge.net
noreply at sourceforge.net
Mon Sep 25 17:08:57 CEST 2006
Bugs item #1565150, was opened at 2006-09-25 11:08
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1565150&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Mike Glassford (glassfordm)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.stat() subsecond file mode time is incorrect on Windows
Initial Comment:
Either the new ability of os.stat() to report subsecond
file modification times, or the os.utime() function,
appears to have a bug on Windows. The following script
illustrates. The problem is that the decimal part of
the modification time reported by os.stat() is always
equal to the decimal part of what was passed to
os.utime() divided by ten (and rounded).
###Begin Script
import os
strPath = "c:/test.xxx"
#Create the file
f = open(strPath, 'w')
f.close()
#Set the file mod time
t1 = 1159195039.2
os.utime(strPath, (t1, t1))
#Get the file mod time
t2 = os.stat(strPath).st_mtime
print t1, t2
###Sample output
1159195039.2 1159195039.02
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1565150&group_id=5470
More information about the Python-bugs-list
mailing list