Azure / azure-cli

Azure Command-Line Interface
MIT License
4k stars 2.98k forks source link

az alias extension broken due to MarkUpSafe version increase #22797

Open MattoHopkins opened 2 years ago

MattoHopkins commented 2 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

AZ alias extension no longer works due to the removal of soft_unicode from latest markupsafe version. https://github.com/aws/aws-sam-cli/issues/3661 <- similar issue, different app

Command Name az alias list

Errors:

'alias' is misspelled or not recognized by the system.
Unable to load extension 'alias: cannot import name 'soft_unicode' from 'markupsafe' (/Users/matthewhopkins/.azure/cliextensions/alias/markupsafe/__init__.py)'. Use --debug for more information.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Expected Behavior

Environment Summary

macOS-12.3.1-x86_64-i386-64bit, Darwin 21.4.0
Python 3.10.4
Installer: HOMEBREW

azure-cli 2.37.0

Extensions:
alias 0.5.2
account 0.2.3

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

yonzhan commented 2 years ago

alias

KaiWalter commented 1 year ago

I also had the error Unable to load extension 'alias: cannot import name 'soft_unicode' from 'markupsafe' (/home/kai/.azure/cliextensions/alias/markupsafe/__init__.py)'. Use --debug for more information. 'alias' is misspelled or not recognized by the system.

with

azure-cli                         2.51.0

core                              2.51.0
telemetry                          1.1.0

Extensions:
alias                              0.5.2

as a quick fix I created and applied this script

#!/bin/bash
set -e
extpath=`az extension list --query "[?name=='alias'].path" -o tsv`
version=2.0.1
wget https://github.com/pallets/markupsafe/archive/refs/tags/$version.tar.gz -O ~/markupsafe-$version.tar.gz
tar xvf ~/markupsafe-$version.tar.gz -C ~
cp ~/markupsafe-$version/src/markupsafe/* $extpath/markupsafe
venukbh commented 12 months ago

An year passed - will it be ever resolved?

thatmlopsguy commented 1 week ago

An year passed - will it be ever resolved?

I had the same issue but thanks to @KaiWalter answer, the problem is now solved.