[New-bugs-announce] [issue17585] IDLE - regression with exit() and quit()

Roger Serwy report at bugs.python.org
Sun Mar 31 09:45:00 CEST 2013


New submission from Roger Serwy:

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.

----------
assignee: roger.serwy
components: IDLE
files: fileno_close.patch
keywords: patch
messages: 185619
nosy: roger.serwy, terry.reedy
priority: critical
severity: normal
stage: patch review
status: open
title: IDLE - regression with exit() and quit()
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file29618/fileno_close.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17585>
_______________________________________


More information about the New-bugs-announce mailing list