I´m also getting the same issue using Python 3.9. Any simple solution?
]1
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a Flask application that uses "asyncio" and using Python Web App deployment. It runs locally within docker with no issues.
After deploying the applications, it refuses to start with an "invalid syntax" error within the standard "asyncio" library.
This happens with either of the Python 3.7 or 3.8 containers.
Error output (example):
I´m also getting the same issue using Python 3.9. Any simple solution?
]1
Hi, initially, I also had the same error with the deployed container. For me simply excluding the asyncio from the pip-requirements did the trick. When you are using Python >= 3.4, asyncio comes with Python as a provisional package.
Cheers, Malte
Hi @Mike Bond ,
You could try re-installing Python 3.8 to fix this issue or follow the solutions provided in this similar SO post
"From version 3.7 async and await are reserved keywords. Copy and open the path (without init.py). You will get a list of .py files
Rename async.py to _async.py or anything you want, as async is now a reserved keyword with us from version 3.7. Once renamed, modify the new name everywhere."
if the issue persists please let us know so we can investigate further.
Thanks,
Grace
TRIED TO SUBMIT A COMMENT - The "Submit" button doesn't work in Edge, Chrome, Firefox, or Safari
Please note the following:
1) This is coming from the BASE Python library for asyncio and has the same error in Python 3.7 and 3.8. What you aren't seeing from the screenshot is that further up in the stacktrace, it is triggered by an "import asyncio" line (base Python, not a PyPi install).
2) Re-installing Python is not an option as this is running in a docker appsvc container provided by Microsoft Azure App Service Python deployments.
3) This works fine in my local docker container using a slightly older container: "appsvc/python:3.8_20200522.6"
4) This works fine running in Python 3.8 under WSL2 also.
5) I realize that "async" and "await" are reserved Python keywords, this is not the issue.
Yes, I saw that article when originally looking into this issue, that is not what is happening here.
Question: Does Microsoft have some specific kernel options enabled/disabled?
I completely rewrote my the "asyncio" library for my application to remove the Python "asyncio" library dependency and it works fine.
Im getting exact same error. Im also running it on Azure WebApp
Is there any easiest solution to this other than rewriting library?