"az interactive" - all commands result in 'NoneType' object has no attribute 'write'
See original GitHub issueDescribe the bug When using “azure interactive shell” on local PC running Win10 Pro in Powershell/command prompt, all az commands retult in following error message:
az>> vm list ‘NoneType’ object has no attribute ‘write’ Traceback (most recent call last): File “C:\Users\troyd\AppData\Local\Temp\pip-install-_jje8pgf\azure-cli-interactive\azure\cli\command_modules\interactive\azclishell\app.py”, line 668, in cli_execute File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\knack\output.py”, line 136, in out print(output, file=out_file, end=‘’) File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\colorama\ansitowin32.py”, line 40, in write self.__convertor.write(text) File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\colorama\ansitowin32.py”, line 141, in write self.write_and_convert(text) File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\colorama\ansitowin32.py”, line 169, in write_and_convert self.write_plain_text(text, cursor, len(text)) File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\colorama\ansitowin32.py”, line 174, in write_plain_text self.wrapped.write(text[start:end]) AttributeError: ‘NoneType’ object has no attribute ‘write’
Azure CLI 2.0 was installed using the MSI installed.
To Reproduce Run the az interactive shell and try any command
Expected behavior On Bash the command result in JSON format is displayed without any error.
Environment summary
Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version
) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)
Azure CLI 2.0 - MSI Installer for Windows 10 Pro (1809) build 17744.1001.
“az --version” output as follow: azure-cli (2.0.44)
acr (2.1.3) acs (2.3.0) advisor (0.6.0) ams (0.2.2) appservice (0.2.2) backup (1.2.0) batch (3.3.2) batchai (0.4.1) billing (0.2.0) cdn (0.1.0) cloud (2.1.0) cognitiveservices (0.2.0) command-modules-nspkg (2.0.2) configure (2.0.18) consumption (0.4.0) container (0.3.3) core (2.0.44) cosmosdb (0.2.0) dla (0.2.1) dls (0.1.0) dms (0.1.0) eventgrid (0.2.0) eventhubs (0.2.2) extension (0.2.1) feedback (2.1.4) find (0.2.12) interactive (0.3.28) iot (0.3.0) iotcentral (0.1.0) keyvault (2.2.2) lab (0.1.0) maps (0.3.1) monitor (0.2.2) network (2.2.3) nspkg (3.0.3) policyinsights (0.1.0) profile (2.1.1) rdbms (0.3.0) redis (0.3.0) relay (0.1.0) reservations (0.3.1) resource (2.1.2) role (2.1.3) search (0.1.1) servicebus (0.2.1) servicefabric (0.1.1) sql (2.1.2) storage (2.2.0) telemetry (1.0.0) vm (2.2.1)
Python location ‘C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe’ Extensions directory ‘C:\Users\sharr.azure\cliextensions’
Python (Windows) 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
Additional context None
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top GitHub Comments
Updated the version. this seems fine in the latest version (2.0.58)
Since this issue was created
az interactive
was moved to an extension. Since it is working correctly in the latest version of the CLI (and thus the latest version of the extension), I will close this issue.