jxmorris12 / language_tool_python

a free python grammar checker 📝✅
GNU General Public License v3.0
434 stars 64 forks source link

Invalid syntax at server.py #26

Closed stan6 closed 4 years ago

stan6 commented 4 years ago

When I run server.py, I got an error:

Traceback (most recent call last): File "language.py", line 1, in import language_tool_python File "/home/usr/.local/lib/python3.5/site-packages/language_tool_python/init.py", line 8, in from .server import LanguageTool, LanguageToolPublicAPI File "/home/usr/.local/lib/python3.5/site-packages/language_tool_python/server.py", line 135 raise FileNotFoundError(f"Failed to find the spellings file at {spelling_file_path}\n" ^ SyntaxError: invalid syntax

The error runs away when i remove the "f" from both lines FileNotFoundError("Failed to find the spellings file at {spelling_file_path}\n" and "print("Updated the spellings at {spelling_file_path}")". Somehow the current syntax is FileNotFoundError(s"...") and print(f"...") which leads to syntax error.

Python version: 3.5

jxmorris12 commented 4 years ago

@stan6 can you upgrade your python version to 3.6 or higher? Those f-strings were added in 3.6, I believe.

In the future I can try and remove the f-strings so this will support Python 3.5.

stan6 commented 4 years ago

Sure. Thanks for your quick reply. I checked the prerequisites (Python 3.3+ ) and thought that Python 3.5 will work fine.

jxmorris12 commented 4 years ago

@stan6 thanks for pointing that out. I removed f-strings so that Python 3.5 should work. And I changed the documentation to say supports Python 3.5+. If you update to version 2.4.6 this should work with 3.5!

stan6 commented 4 years ago

Sure. @jxmorris12 Thanks for the speedy reply! I will close the issue then!