unsupported character in PyTime format string causes python 2.7.8 crash
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
To clarify: Python itself crashes.
Environment:
Python 2.7.8 (32-bit) on Windows 7
Running from console window with .py extension set in PATH_EXT environment variable.
import win32file ftest = 'c:\\temp\\temp.txt' print '\n' + ftest handle_ftest = win32file.CreateFile(ftest,win32file.GENERIC_READ,0,None,win32file.OPEN_EXISTING,0,None) py_ctime, py_atime, py_mtime = win32file.GetFileTime(handle_ftest) #print py_ctime.Format('%Y-%m-%d %H:%M:%S.%f') #<< unsupported millisecond format parameter causes python 2.7 to crash print py_ctime.Format('%Y-%m-%d %H:%M:%S') #<< otherwise works fine handle_ftest.close
workaround:
ignore ms or use built-in datetime instead.
Cheers,
--bm
Note:
Confirmed behaviour identical in v2.7.9