Author ncoghlan
Recipients ncoghlan
Date 2014-02-07.12:47:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391777254.4.0.885932258701.issue20541@psf.upfronthosting.co.za>
In-reply-to
Content
In trying to figure out why my fix for issue 20053 wasn't working on Windows, I eventually traced it back to the fact that "os.path.exists(os.devnull)" returns False on Windows, so pip isn't picking up my config file override in ensurepip, and reads the global default config file anyway.

However, if you do "if exist NUL (echo exists) ELSE (echo missing)" in cmd, it will print "exists", so this looks like a bug in our os.path.exists implementation.

That is currently implemented in genericpath and assumes that a file exists if-and-only-if os.stat(name) doesn't throw an exception.

It turns out this assumption isn't really correct on Windows - 'NUL' and 'CON' (and presumably other special files) can be opened, but trying to do os.stat() on them throws an exception.
History
Date User Action Args
2014-02-07 12:47:34ncoghlansetrecipients: + ncoghlan
2014-02-07 12:47:34ncoghlansetmessageid: <1391777254.4.0.885932258701.issue20541@psf.upfronthosting.co.za>
2014-02-07 12:47:34ncoghlanlinkissue20541 messages
2014-02-07 12:47:33ncoghlancreate