Invalid syntax error in main.py
I cloned interactive-tutorials locally and installed Flask with the intention to verify my contributes. When I start Flask with
FLASK_APP="main.py -d learnpython.org" flask run
I got the error
File "/home/fabrizio/interactive-tutorials/main.py", line 152 except Exception, e:
I'm using Python 3.5.2
I have the same error using Python 3. Solution:
- Install python2-flask
- Run "python2 main.py -d learnpython.org"
C:\Users\sharanJs\interactive-tutorials>py -2 main.py -d learnpython.org
Traceback (most recent call last):
File "main.py", line 225, in <module> init_tutorials() File "main.py", line 190, in init_tutorials tutorial_dict["page_title"] = tutorial.decode("utf8")
File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecode
Error: 'utf8' codec can't decode byte 0xe0 in position 9: invalid continuation byte
I'm getting this error in python2.7.17, what's the fix?