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 roger.serwy
Recipients roger.serwy, terry.reedy
Date 2013-03-31.07:44:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1364715900.07.0.37447718586.issue17585@psf.upfronthosting.co.za>
In-reply-to
Content
This issue is a split from #5492, where Terry noticed a serious regression that "quit()" and "exit()" no longer work in IDLE.

Before #9290, the PyShell object itself was stdin and it didn't have a "fileno" method. The code in site.py would skip over the call to fileno, leaving fd == -1, which then called close() on stdin, effectively the close() method of PyShell. 

The application of #9290 introduced PseudoFile as a subclass of io.TextIOBase which has a "fileno" method. The site.py code find it, calls it, but an error gets raised so that the close() method doesn't get called. Even if you subclass fileno(), you still need to subclass close() so that it calls the original close function in PyShell.

The attached patch, fileno_close.patch, fixes that issue. I would argue that this patch should be applied to all the release candidates as it corrects a serious regression.

I would like to hear your thoughts before applying the patch.
History
Date User Action Args
2013-03-31 07:45:00roger.serwysetrecipients: + roger.serwy, terry.reedy
2013-03-31 07:45:00roger.serwysetmessageid: <1364715900.07.0.37447718586.issue17585@psf.upfronthosting.co.za>
2013-03-31 07:44:59roger.serwylinkissue17585 messages
2013-03-31 07:44:59roger.serwycreate