asyncio
asyncio copied to clipboard
asyncio 3.4.3 breaks python 2.7
Installing asyncio 3.4.3 on python 2.7 break python:
File "/usr/local/lib/python2.7/site-packages/asyncio/selectors.py", line 39
"{!r}".format(fileobj)) from None
^
SyntaxError: invalid syntax
If asyncio is not compatible with python 2.7, it should refuse to install. I am not sure which package managed to installed it.
Hi @ssbarnea,
AsyncIO works only on Python 3.3+.
You have Trollius for Python 2.7, but not supported anymore by @haypo.
If possible, I recommend to use directly Python 3.5+ directly, for async/await syntax.
Have a nice day.
Yes, I do know that asyncio doesn't work with Python < 3.3, but this bug is about the fact that people can install asyncio
and this will break their Python installations!
This is a real bug which can be prevented with a simple python version check inside setup.py
, avoiding such accidents.
What is even worse is that it will take some time for people to realise that their python 2.x is messed because of the asyncio, they will not find it right away.
Ok.
Are you interested in to do a pull request for that ? To my understanding, a thing like that should be enough: https://github.com/KeepSafe/aiohttp/blob/master/setup.py#L59
Fixed by #387.
Well, I installed it today for my python 2.7 successfully. But when I tried to import asyncio I got:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/asyncio/__init__.py", line 9, in <module>
from . import selectors
File "/usr/local/lib/python2.7/dist-packages/asyncio/selectors.py", line 39
"{!r}".format(fileobj)) from None
^
SyntaxError: invalid syntax
Same as jan. Just installed it asyncio today for Python 2.7 and got the same error.
Hi,
In fact, the pull request #387 has been merged but never pushed on PyPI. @haypo @1st1 you have the rights to update the asyncio package, what we do ?
For me, we might force that the asyncio package on PyPI can be installed for Python 3.3: People might have side effects if they install asyncio module from PyPI, where the latest release is 2015-03-10 on a Python 3.6, with a more recent asyncio version.
If you have no time for that, you might give me an access on PyPI to update the package, as you like.