Martin v. Löwis <mar...@v.loewis.de> added the comment: > 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. _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4915> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com