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 eryksun
Recipients eryksun, xxm
Date 2021-03-24.03:38:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1616557122.5.0.55120574231.issue43610@roundup.psfhosted.org>
In-reply-to
Content
> 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.
History
Date User Action Args
2021-03-24 03:38:42eryksunsetrecipients: + eryksun, xxm
2021-03-24 03:38:42eryksunsetmessageid: <1616557122.5.0.55120574231.issue43610@roundup.psfhosted.org>
2021-03-24 03:38:42eryksunlinkissue43610 messages
2021-03-24 03:38:42eryksuncreate