directory bug on linux; workaround?

John Lenton john at grulic.org.ar
Thu Jan 13 19:06:27 EST 2005


On Thu, Jan 13, 2005 at 12:07:04PM -0800, Russell E. Owen wrote:
> I stumbled across a really strange bug involving directories on linux.
> 
> os.path.exists(path) can return 0 even after os.path.mkdir(path) 
> succeeds (well after; this isn't a timing issue).
> 
> For the first file, the directory did not exist, so my code created the 
> directory (successfully) using  os.path.mkdir(path). The next file 
> failed because os.path.exists(path) returned false, so my code tried to 
> create the directory again, which failed with "directory exists".
> 
> It seems that the path was to a "fat" file partition and included a 
> directory name that was all uppercase. The directory was created, but 
> using lowercase. I'm not yet sure the version of python.
> 
> The workaround for now is to not use fat file partitions. But I was 
> wondering if anyone had a better option?

the bug is because os.path is assuming posix semantics, which fat
doesn't have.

Not using fat sounds like the best idea to me, but I'm probably
strongly biased against that piece of crap.

-- 
John Lenton (john at grulic.org.ar) -- Random fortune:
A fox is a wolf who sends flowers.
		-- Ruth Weston
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20050113/5e5a9163/attachment.sig>


More information about the Python-list mailing list