-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hundreds of "SyntaxWarning: invalid escape sequence" will break in future python versions #28829
Comments
Thank you for opening this issue, we will look into it. |
For reference this is the change in cPython that raises the SyntaxWarning, in a future version of python it will be an error: This has been deprecated since 3.6. |
Azure/autorest.python#2560 is merged and it means that new Azure SDK package versions won't have this warning. For commands themselves, I opened Azure/aaz-dev-tools#360. I think these will solve the issue completely, when the latter is merged and new code is generated. |
I needed to open Azure/aaz-dev-tools#365 too. |
This error doesn't appear in official CLI packages because it's already compiled into byte code. Official fix guide
Here is the code that need to be fixed:
|
First run of just "az" results in these three:
versions:
|
|
@bebound $ az login
/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/batch/models/_models_py3.py:4839: SyntaxWarning: invalid escape sequence '\s'
"""A Job Preparation Task to run before any Tasks of the Job on any given |
@K3UL I've reported this to Azure/azure-sdk-for-python#38618. There's nothing we can do; the upstream needs to fix this. This only happens once on macOS. |
to me this happens when I do az webapp ... (anything)
/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/mgmt/web/v2023_01_01/models/_models_py3.py:20621: SyntaxWarning: invalid escape sequence '\S'
"""Configuration of an App Service app.
/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/mgmt/web/v2023_01_01/models/_models_py3.py:20981: SyntaxWarning: invalid escape sequence '\S'
"""
/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/mgmt/web/v2023_01_01/models/_models_py3.py:21292: SyntaxWarning: invalid escape sequence '\S'
"""Web app configuration ARM resource.
/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/mgmt/web/v2023_01_01/models/_models_py3.py:21680: SyntaxWarning: invalid escape sequence '\S'
""" but everything else works normally |
Still present on first run of
|
Seeing these errors on MacOS v15.2, just installed az cli today:
|
also here |
This has been happening to me as well. For temporary relief until a new $ cd /usr/local/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages
$ ruff check --fix --select W605
Found 2135 errors (2135 fixed, 0 remaining). |
Describe the bug
We see many syntax warnings with python 3.12 which will be syntax errors in a future versions of python.
Related command
Any command that goes through the bad code, including
az login
.Errors
Issue script & Debug output
N/A
Expected behavior
The az-cli should not spew any syntax warnings.
Environment Summary
azure-cli==2.59.0
Python 3.12.3
Additional context
These syntax issues have been deprecated in Python for several python releases, 3.12 is showing the issues more explicitly since they are planned to break runtime in the future.
This should be fixed very promptly.
The text was updated successfully, but these errors were encountered: