Skip to content
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

CLI dies if output pipe is broken. #58

Closed
binderjoe opened this issue Mar 10, 2016 · 5 comments
Closed

CLI dies if output pipe is broken. #58

binderjoe opened this issue Mar 10, 2016 · 5 comments
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.
Milestone

Comments

@binderjoe
Copy link

If cli output is attached to a broken pipe, it will crash. Example: 'az vm list | jfhksfh'
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 170, in _run_module_as_main
"main", mod_spec)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/joe/azure-cli/src/azure/cli/main.py", line 5, in
sys.exit(azure.cli.main.main(sys.argv[1:]))
File "/Users/joe/azure-cli/src/azure/cli/main.py", line 47, in main
OutputProducer(formatter=formatter, file=file).out(cmd_result.result)
File "/Users/joe/azure-cli/src/azure/cli/_output.py", line 62, in out
print(self.formatter(obj), file=self.file)
BrokenPipeError: [Errno 32] Broken pipe

@derekbekoe
Copy link
Member

Looking into this.

@mayurid
Copy link
Member

mayurid commented Apr 7, 2016

@derekbekoe : Close the issue?

@derekbekoe
Copy link
Member

This isn't resolved right now.
I looked at this but my associated PR (#61) is to be revisited as a different way of solving this was suggested.

@JasonRShaver
Copy link
Contributor

Example from recent build:

jasonsha@JasonShaMBP: ~ $ az vm list | asdfasdf
-bash: asdfasdf: command not found
[Errno 32] Broken pipe
Traceback (most recent call last):
  File "/usr/local/az/envs/default/lib/python2.7/site-packages/azure/cli/main.py", line 55, in main
    OutputProducer(formatter=formatter, file=file).out(cmd_result)
  File "/usr/local/az/envs/default/lib/python2.7/site-packages/azure/cli/_output.py", line 74, in out
    print(output, file=self.file, end='')
IOError: [Errno 32] Broken pipe

@JasonRShaver JasonRShaver added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Aug 3, 2016
@JasonRShaver JasonRShaver added this to the Backlog milestone Aug 3, 2016
@mayurid
Copy link
Member

mayurid commented Aug 26, 2016

Closing as #770 is tracking this

@mayurid mayurid closed this as completed Aug 26, 2016
@haroldrandom haroldrandom added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.
Projects
None yet
Development

No branches or pull requests

5 participants