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 jnoller
Recipients OG7, grahamd, i000, jnoller, ptn
Date 2009-06-19.21:53:43
SpamBayes Score 9.5105035e-12
Marked as misclassified No
Message-id <>
In-reply-to <>
On Fri, Jun 19, 2009 at 11:55 AM, OG7<> wrote:
> OG7 <> 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:45jnollersetrecipients: + jnoller, OG7, grahamd, ptn, i000
2009-06-19 21:53:44jnollerlinkissue5313 messages
2009-06-19 21:53:43jnollercreate