Yonatan Zunger added the comment:
Eryk: Thanks for finding that! So that I'm sure I understand, if 34187 is
resolved, does that mean the stdin.close() is no longer required at all in
_Quitter?
On Sun, Jul 22, 2018 at 2:12 AM Eryk Sun wrote:
>
> Eryk Sun added the comment:
>
Yonatan Zunger added the comment:
Definitely agree about the difference.
I'd say that either SystemExit or EOFError would be a reasonable thing for
the interactive session to do, but the combination of closing stdin and
SystemExit is really weird. Honestly, I would have just expected int
Yonatan Zunger added the comment:
Or perhaps in an alternate phrasing: The sys.stdin.close behavior makes sense
if quit is being used inside IDLE, but is very surprising from the perspective
of the `code` module. (Really, even the SystemExit is surprising there, and
should be documented
Yonatan Zunger added the comment:
Testing your code sample on OS X (10.13.6) with Python 3.6.2:
- quit() in the console yields
Exc 0: closed is True
Python 3.6.2 (default, Apr 17 2018, 12:29:33)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin
Type "help",
New submission from Yonatan Zunger :
code.InteractiveConsole.interact() closes stdin on exit, which can be very
surprising to successive code, not least future calls to interact(). A simple
repro with a workaround is:
import code
import io
import os
import sys
def run():
print
Yonatan Zunger added the comment:
Apologies -- I've been completely swamped and haven't had time to build a repro
case. I don't think I have enough state on the way I found this to reconstruct
it easily right now, so I'll close it and re-open if I find it again.
-
Yonatan Zunger added the comment:
3.6.2. But Nick Coghlan pointed out elsewhere that the underlying issue is
more likely to be one of the other objects being pinned in-memory because
of the traceback, so the exception may actually be just an incidental
thing. I'm going to have to work
Yonatan Zunger added the comment:
It's just a clean version of reraise. Part of the six (Py2/Py3
compatibility) library, but pretty useful on its own anyway.
On Sun, Dec 24, 2017 at 8:37 PM, Nitish wrote:
>
> Nitish added the comment:
>
> What is six.rerais
New submission from Yonatan Zunger :
Using the following decorator to memoize a function causes the interpreter to
segfault on exit if any exceptions were stored in the cache. Changing the bad
line to instead store copy.copy(e) makes the problem go away.
Almost certainly some kind of problem