vibora icon indicating copy to clipboard operation
vibora copied to clipboard

SyntaxError: invalid syntax -- self.async = iscoroutinefunction(handler)

Open jakealstad opened this issue 7 years ago • 16 comments

Attempting to run the example server code from the docs using Python 3.7.0b2 in pyenv on Mac OS 10.13.5. I haven't looked deep into the source yet but I am wondering if this is a known issue/incompatibility with Python 3.7.

✘  vibora_test  ~/P/vibora_test  python app.py Traceback (most recent call last): File "app.py", line 1, in <module> from vibora import Vibora, Request File "/Users/jalstad/.pyenv/versions/vibora_test/lib/python3.7/site-packages/vibora/__init__.py", line 7, in <module> from .server import * File "/Users/jalstad/.pyenv/versions/vibora_test/lib/python3.7/site-packages/vibora/server.py", line 11, in <module> from .workers.handler import RequestHandler File "/Users/jalstad/.pyenv/versions/vibora_test/lib/python3.7/site-packages/vibora/workers/handler.py", line 7, in <module> from ..hooks import Events File "/Users/jalstad/.pyenv/versions/vibora_test/lib/python3.7/site-packages/vibora/hooks.py", line 38 self.async = iscoroutinefunction(handler) ^ SyntaxError: invalid syntax

jakealstad avatar Jun 20 '18 16:06 jakealstad

I was not aware of this issue, interesting... I'll push a fix tonight... I'll add Python 3.7 to the build pipeline so we can catch more of these... Thanks bro!

frnkvieira avatar Jun 20 '18 16:06 frnkvieira

@frnkvieira No problem! If I wasn't at work I'd submit a PR myself :D

jakealstad avatar Jun 20 '18 16:06 jakealstad

How do we solve this? I'm still experiencing it 😔

johnpaulada avatar Jul 05 '18 05:07 johnpaulada

Oh the version at master works but the entry at PyPI isn't updated.

johnpaulada avatar Jul 05 '18 06:07 johnpaulada

yes. this occurs on python 3.7.

bencagri avatar Jul 10 '18 12:07 bencagri

yes . this is error on python 3.7

on my environment

  • MacOS mojave version 10.14
  • python3.7 (virtualenv)
  • Vibora 0.0.6
Traceback (most recent call last):
  File "app.py", line 1, in <module>
    from vibora import Vibora, JsonResponse
  File ".../lib/python3.7/site-packages/vibora/__init__.py", line 7, in <module>
    from .server import *
  File ".../lib/python3.7/site-packages/vibora/server.py", line 11, in <module>
    from .workers.handler import RequestHandler
  File "../lib/python3.7/site-packages/vibora/workers/handler.py", line 7, in <module>
    from ..hooks import Events
  File ".../lib/python3.7/site-packages/vibora/hooks.py", line 38
    self.async = iscoroutinefunction(handler)
             ^
SyntaxError: invalid syntax

but I check latest of master branch (version 0.0.7) its work (manual install)

r17x avatar Nov 01 '18 04:11 r17x

Any updates with this issue? Im still having this problem with Python 3.7

Traceback (most recent call last): File "index.py", line 1, in <module> from vibora import Vibora, JsonResponse File "/home/capcrunch/.local/lib/python3.7/site-packages/vibora/__init__.py", line 7, in <module> from .server import * File "/home/capcrunch/.local/lib/python3.7/site-packages/vibora/server.py", line 11, in <module> from .workers.handler import RequestHandler File "/home/capcrunch/.local/lib/python3.7/site-packages/vibora/workers/handler.py", line 7, in <module> from ..hooks import Events File "/home/capcrunch/.local/lib/python3.7/site-packages/vibora/hooks.py", line 38 self.async = iscoroutinefunction(handler) ^ SyntaxError: invalid syntax

IsaacDdR avatar Aug 07 '19 16:08 IsaacDdR

The same problem...

isleifeng avatar Aug 16 '19 02:08 isleifeng

https://docs.python.org/3/whatsnew/3.7.html => in 3.6, if you activate warning, it warn you about async and await being keyword also. In 3.7 async and await are not accepted as var name anymore. At this time vibora is not compatible with python 3.7

RemiDesgrange avatar Aug 19 '19 07:08 RemiDesgrange

This bug is still existing Python 3.7 version. Anybody get a solution ? or need to downgrade Python version. thanks

vubon avatar Dec 11 '19 11:12 vubon

This bug is also present in Python 3.8 solutions?

Ubuntu 18.04 Python 3.8.1 Pyenv 1.2.16 PipEnv 2018.11.26

pipenv update --python 3.8 pipenv install vibora[fast]

(async) fbenavides@x360:~/src/async$ python Python 3.8.1 (default, Feb 2 2020, 02:21:52) [GCC 9.2.1 20191008] on linux Type "help", "copyright", "credits" or "license" for more information.

import vibora Traceback (most recent call last): File "", line 1, in File "/home/fbenavides/.local/share/virtualenvs/async--osfTGhM/lib/python3.8/site-packages/vibora/init.py", line 7, in from .server import * File "/home/fbenavides/.local/share/virtualenvs/async--osfTGhM/lib/python3.8/site-packages/vibora/server.py", line 11, in from .workers.handler import RequestHandler File "/home/fbenavides/.local/share/virtualenvs/async--osfTGhM/lib/python3.8/site-packages/vibora/workers/handler.py", line 7, in from ..hooks import Events File "/home/fbenavides/.local/share/virtualenvs/async--osfTGhM/lib/python3.8/site-packages/vibora/hooks.py", line 38 self.async = iscoroutinefunction(handler) ^ SyntaxError: invalid syntax

fbenavides69 avatar Feb 02 '20 21:02 fbenavides69

any update?

thehackercat avatar Apr 28 '20 07:04 thehackercat

Any upd ?

TacoBel42 avatar May 13 '20 17:05 TacoBel42

This is fixed in the vibora code on Github, but it hasn't been pushed to PyPI. If you really want it to work, install Vibora directly via git instead of PyPI

therumbler avatar May 24 '20 13:05 therumbler

?

ucodelukas avatar Oct 02 '20 12:10 ucodelukas

In Ubuntu,

  1. sudo pip install cython3 (Install cython3)
  2. git clone https://github.com/vibora-io/vibora.git
  3. cd vibora
  4. nano build.py: change the line cython = os.path.join(os.path.dirname(sys.executable), 'cython') to cython = "cython"
  5. sudo python3 build.py
  6. sudo python3 setup.py install

palaniyappanBala avatar Mar 26 '22 07:03 palaniyappanBala