Message89529
On Fri, Jun 19, 2009 at 11:55 AM, OG7<report@bugs.python.org> wrote:
>
> OG7 <onyxg7@users.sourceforge.net> added the comment:
>
> One shouldn't close the fileno after the file has been closed. The
> stdlib raises an error, and the open(os.devnull) won't be reached. If no
> error was thrown, it would be worse. This would be closing a fileno that
> doesn't belong to sys.stdin anymore and may be used somewhere else.
>
> The open(os.devnull) bit is both so that no one tries to do anything
> with the old stdin anymore, and to let applications attempt to read from
> stdin without an IOError.
Fair enough, I was worried a bit about skipping the
os.close(sys.stdin.fileno()) - the tests pass with both (because the
close fixes the basic problem). I need to come up with an appropriate
documentation note about the double flush issue, add in the tests I
gleaned from the other bugs and commit it. I'll post the full
doc/tests/code patch before doing so. |
|
Date |
User |
Action |
Args |
2009-06-19 21:53:45 | jnoller | set | recipients:
+ jnoller, OG7, grahamd, ptn, i000 |
2009-06-19 21:53:44 | jnoller | link | issue5313 messages |
2009-06-19 21:53:43 | jnoller | create | |
|