Reputation: 128
I am a beginner in python. Unfortunately, I just deleted the:
..Python3.5/http/
directory.
To fix that, I downloaded the same from https://github.com/python/cpython/tree/master/Lib/http
But when I run any script that needs the content of the deleted folder, I get this error
File "/usr/lib/python3.5/http/client.py", line 1063
chunk = f"{len(chunk):X}\r\n".encode('ascii') + chunk \
^
SyntaxError: invalid syntax
What is the syntax error and how can I fix this ?
Thanks in Advance
Upvotes: 1
Views: 898
Reputation: 811
The line that is throwing the error is using the new 'f-string' syntax introduced in Python 3.6. You are trying to run it with Python 3.5 which does not support this feature.
To fix this you could either redownload the files from 3.5 branch or just reinstall Python using the installer.
Upvotes: 2