[Core] cli should have a centralized interactive input() function that checks if STDIN is a TTY
Username: ERROR: EOF when reading a line
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/azure/cli/main.py", line 33, in main
cmd_result = APPLICATION.execute(args)
File "/usr/local/lib/python3.5/site-packages/azure/cli/core/application.py", line 139, in execute
result = expanded_arg.func(params)
File "/usr/local/lib/python3.5/site-packages/azure/cli/core/commands/__init__.py", line 274, in _execute_command
result = op(client, **kwargs) if client else op(**kwargs)
File "/usr/local/lib/python3.5/site-packages/azure/cli/command_modules/acr/repository.py", line 78, in acr_repository_list
return _validate_user_credentials(registry_name, path, 'repositories', username, password)
File "/usr/local/lib/python3.5/site-packages/azure/cli/command_modules/acr/repository.py", line 67, in _validate_user_credentials
username = user_input("Username: ")
EOFError: EOF when reading a line
As requested by @ahmetalpbalkan
How's this different than #1348?
Also it's not ACR specific I believe. azure-cli should have a centralized interactive input() function that checks if STDIN is a TTY and if not, it should return a nicer error (instead of a stack trace).
https://github.com/Azure/azure-cli/issues/1349 is to track the issue in our command module or azure-cli in general, https://github.com/Azure/azure-cli/pull/1348 is the PR to fix our command module.
ah you can add [ACR] prefix to issue to disambiguate.
We should find all uses of input() and getpass() and guard these calls by checking if tty is available.
See _prompting.py in the core module for where this change should go.