-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
webargs.async and webargs.aiohttpparser contain un-guarded Python 3 syntax #105
Comments
Isn't this the same as issue #86? Ultimately, the problem is that tools attempt to force byte-compilation without considering syntax errors being reported during parsing (not execution). There's nothing that can be done about this from within the code of the offending modules, aside from avoiding Python 3 syntax completely. I'm not sure there's a valid reason for that in the case of these particular modules. Ultimately, byte-compilation steps from tools should tolerate these syntax errors and simply not install generated .pyc files for modules that trigger these errors. |
Alternately, these modules could be dropped from installations targeting Python 2. Making the tools (setuptools, pip, the Debian install process) more resilient is probably the better approach, because it applies to all packages, rather than forcing all affected packages to worry about this. But this can be reasonably argued either way. |
There doesn't seem to be a clean way to do this in One alternative would be to separate the aiohttp code into a separate package. It's really not ideal though, because that would be a breaking change. |
I am having this problem as well, trying to release webargs for ROS IMHO, using FromWrapper() from trollius for now (not a breaking change I believe) is probably best option... How about it ? And maybe at some point in the future, separate "all async" behavior requiring python3, in a different subpackage/plugin ? I m kind of expecting more async driven python3 webservers will appear... |
Closing this for now, since we don't have plans on making changes to support this. |
pip install webargs
orsetuptools
-based installpython setup.py install
ofwebargs
when using Python 2.x results inSyntaxError
on either of these statements:Perhaps it makes sense to incorporate an import guard that would raise an
ImportError
instead, or something that would more clearly indicate that those sub-modules aren't available when using Python 2.xIncidentally, I came across this while trying to create conda packages for
webargs
that work with Python 2.7.The text was updated successfully, but these errors were encountered: