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 terry.reedy
Recipients Boris.FELD, ajaksu2, gerluijten, gpolo, roger.serwy, srid, terry.reedy
Date 2013-03-31.00:52:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1364691138.78.0.54998007943.issue5492@psf.upfronthosting.co.za>
In-reply-to
Content
I am presuming 2.7 has same problem since it has same code.

The patch appears to give PyShell.close a return value it did not have before. Perhaps remove the return?

I am slightly puzzled: self.pollinterval is 50 (millisecs). If reducing the wait from 100 to 1 makes the problem constant, why does reducing it to 0 make it go away? What have I misunderstood?

Trying to test on Windows in a 3.3 build, I get the following with or without the patch:

>>> exit()
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    exit()
  File "D:\Python\dev\py33\lib\site.py", line 380, in __call__
    raise SystemExit(code)
SystemExit: None
--------------------------------
def __call__(self, code=None):
            # Shells like IDLE catch the SystemExit, but listen when
            # stdin wrapper is closed.
            try:
                fd = -1
                if hasattr(sys.stdin, "fileno"):
                    fd = sys.stdin.fileno()
                if fd != 0:
                    # Don't close stdin if it wraps fd 0
                    sys.stdin.close()
            except:
                pass
            raise SystemExit(code)
>>>
---------------------------
<bare excepts are evil>
----------------------------
>>> import sys
>>> hasattr(sys.stdin, "fileno")
True
>>> sys.stdin.fileno
<built-in method fileno of PseudoInputFile object at 0x02893C08>
>>> sys.stdin.fileno()
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    sys.stdin.fileno()
io.UnsupportedOperation: fileno

The problem is that PseudoInputFile subclasses PseudoFile which now subclasses TestIOBase without overriding .fileno(), which raises the above. This is from #9290.

Bottom line: I believe quit() and exit() are broken in the current 2.7, 3.2, and 3.3 rc's. I will report a possible quick fix on pydev.
History
Date User Action Args
2013-03-31 00:52:18terry.reedysetrecipients: + terry.reedy, ajaksu2, gpolo, roger.serwy, gerluijten, srid, Boris.FELD
2013-03-31 00:52:18terry.reedysetmessageid: <1364691138.78.0.54998007943.issue5492@psf.upfronthosting.co.za>
2013-03-31 00:52:18terry.reedylinkissue5492 messages
2013-03-31 00:52:18terry.reedycreate