Describe the bug
Trying to download a certificate with the az certificate download command, on azure cli 2.16 and python 3.9, crashes with the error module 'base64' has no attribute 'encodestring'
To Reproduce
-
Have python 3.9 and azure cli 2.16
-
Have a keyvault mykeyvault with a certificate mycert
-
az keyvault certificate download -n mycert --vault-name mykeyvault --file mycert.crt
Expected behavior
The certificate should be downloaded and stored as mycert.txt
Environment summary
Additional context
The Python 3.9 release notes seem to describe the reason and fix quite well:
base64.encodestring() and base64.decodestring(), aliases deprecated since Python 3.1, have been removed: use
base64.encodebytes() and base64.decodebytes() instead. (Contributed by Victor Stinner in bpo-39351.)
Describe the bug
Trying to download a certificate with the
az certificate downloadcommand, on azure cli 2.16 and python 3.9, crashes with the error module 'base64' has no attribute 'encodestring'To Reproduce
Have python 3.9 and azure cli 2.16
Have a keyvault mykeyvault with a certificate mycert
az keyvault certificate download -n mycert --vault-name mykeyvault --file mycert.crtExpected behavior
The certificate should be downloaded and stored as
mycert.txtEnvironment summary
Install Method: dnf package manager with the https://packages.microsoft.com/yumrepos/azure-cli yum repo
CLI Version:
OS version: Fedora Linux 33 (which comes with Python 3.9 preinstalled)
Shell type: Bash
Additional context
The Python 3.9 release notes seem to describe the reason and fix quite well: