New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tarfile: Exception ignored in (... stdout ...) BrokenPipeError #84032
Comments
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". |
I will take look at this issue :) |
Victor, If you remove the try: finally statement. But I'd like to listen to your opinion before submitting the patch. :) ➜ cpython git:(master) ✗ set -o pipefail |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: