os.stat() distorts filenames that end with period (nt.stat())

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Sep 6 22:32:59 EDT 2012


On Thu, 06 Sep 2012 17:55:02 -0700, ruck wrote:

> (This with Python 2.7.2 on Windows 7)
> 
> os.stat() won't recognize a filename ending in period. It will ignore
> trailing periods.
> If you ask it about file 'goo...' it will report on file 'goo' And if
> 'goo' doesn't exist, os.stat will complain.


I don't have access to a Windows machine to test this, but I suspect that 
you have found a side-effect of a Windows bug.

http://answers.microsoft.com/en-us/windows/forum/windows_7-files/files-disappear-when-you-append-a-period-to-a/4329b1f1-746e-4c45-9c32-75622b6ab526

http://support.microsoft.com/kb/115827



-- 
Steven



More information about the Python-list mailing list