Message389435
> 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. |
|
Date |
User |
Action |
Args |
2021-03-24 03:38:42 | eryksun | set | recipients:
+ eryksun, xxm |
2021-03-24 03:38:42 | eryksun | set | messageid: <1616557122.5.0.55120574231.issue43610@roundup.psfhosted.org> |
2021-03-24 03:38:42 | eryksun | link | issue43610 messages |
2021-03-24 03:38:42 | eryksun | create | |
|