Message363368
When a stdout pipe is closed on the consumer side, Python logs an exception at exit:
$ ./python -m tarfile -l archive.tar|true
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe
I tried to flush explicitly stdout at exit: it allows to catch BrokenPipeError... but Python still logs the exception, since it triggered by the TextIOWrapper finalizer which tries to flush the file again.
See also bpo-39828: "json.tool should catch BrokenPipeError". |
|
Date |
User |
Action |
Args |
2020-03-04 18:03:06 | vstinner | set | recipients:
+ vstinner, corona10 |
2020-03-04 18:03:06 | vstinner | set | messageid: <1583344986.43.0.320216561528.issue39851@roundup.psfhosted.org> |
2020-03-04 18:03:06 | vstinner | link | issue39851 messages |
2020-03-04 18:03:06 | vstinner | create | |
|