question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"az interactive" - all commands result in 'NoneType' object has no attribute 'write'

See original GitHub issue

Describe 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
neville-nazeranecommented, Feb 25, 2019

Updated the version. this seems fine in the latest version (2.0.58)

0reactions
tjprescottcommented, Feb 25, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"az interactive" - all commands result in 'NoneType' object has ...
"az interactive" - all commands result in 'NoneType' object has no attribute ... AttributeError: 'NoneType' object has no attribute 'write'.
Read more >
NoneType object has no attribute 'write' - Stack Overflow
Stupid me, I did not define the object control but used it in the main script. Fixed now by defining "control" in the...
Read more >
Release notes & updates – Azure CLI - Microsoft Learn
Learn about the latest Azure Command-Line Interface (CLI) release notes and updates for both the current and beta versions of the CLI.
Read more >
How do I resolve "ERROR Failed to write data to transport with ...
Articles How do I resolve "ERROR Failed to write data to transport with 'NoneType' object has no attribute 'write'" when using the Duo...
Read more >
'NoneType' object has no attribute - GIS Stack Exchange
So basically, what this is saying, in Python speak, is that your attempt to open the shapefile failed. When something like osgeo.ogr.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found