-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
json.tool should catch BrokenPipeError #84009
Comments
The json.tool module doesn't catch BrokenPipeError: $ echo "{}" | python3 -m json.tool | true
BrokenPipeError: [Errno 32] Broken pipe During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/lib64/python3.7/json/tool.py", line 45, in <module>
main()
File "/usr/lib64/python3.7/json/tool.py", line 41, in main
outfile.write('\n')
BrokenPipeError: [Errno 32] Broken pipe json.tool should catch BrokenPipeError. |
I'd like to work on this issue but what should it do when it captures that error. |
See also bpo-39851: "tarfile: Exception ignored in (... stdout ...) BrokenPipeError" which is a different but similar issue. |
Thanks Dong-hee Na for the fix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: