Eryk Sun <eryk...@gmail.com> added the comment:
> Python interpreter will exit when using Ctrl C to interrupt > some Python module functions with read operations. The REPL exits when stdin is closed. open() allows the filename to be an existing file descriptor without requiring a parameter such as "file_is_fd". So it's really simple to accidentally close stdin with something like `with open(0): pass`. The only role of Ctrl+C here is in canceling a blocking operation in the context such as a read(), after which the file is guaranteed to be closed by the context manager protocol. ---------- nosy: +eryksun type: crash -> behavior _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43610> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com