This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients eckhardt, loewis
Date 2009-01-11.20:35:13
SpamBayes Score 0.24469
Marked as misclassified No
Message-id <496A57FE.9040906@v.loewis.de>
In-reply-to <1231704324.93.0.216806586561.issue4915@psf.upfronthosting.co.za>
Content
> I don't really know what happens when you try to read()/fread() from 
> stdin that is a directory, but I guess it will fail quickly even 
> without an explicit check by Python.

Without the explicit check, the interpreter crashed; this was the
reason to add the check in the first place. See issue 887946.

> A directory can be opened under 
> win32 just like a file, so I guess that you could also set one as 
> stdin for a process. 

I just tried to run

python.exe < c:\python25

on W2k3, and get "Access denied" (instead of getting the error
message of the Python interpreter). Indeed, it is apparently
*not* possible to open a directory just like a file under win32.
As

http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx

explains: you must pass FILE_FLAG_BACKUP_SEMANTICS, which
you normally don't pass.

Not sure whether this all applies to CE, though.

> All in all, I don't care whether the check is 
> made or not, but it doesn't hurt to be there either.

It does hurt. It clutters the code. So if it could be determined
that you can't open a directory at all with CreateFile on
Windows CE, then it would be better if the block was removed,
than fixed.
History
Date User Action Args
2009-01-11 20:35:15loewissetrecipients: + loewis, eckhardt
2009-01-11 20:35:14loewislinkissue4915 messages
2009-01-11 20:35:13loewiscreate