I get this error in Eclipse while working on "Byte of Python"
It says the error shows up in 2 lines:
source = ["C:\\My Documents", "C:\\Code"]
and
zip_command = "zip -qr {0} {1}".format(target, ‚ ‚.join(source))
I cant really figure out what im doing wrong here.
Here's the full error:
SyntaxError: Non-UTF-8 code starting with '\x82' on line x, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
-
Thanks that was it. Feel kinda stupid now. Thanks a lot. Didn't even know this could cause problems.Elmer– Elmer2013年03月24日 18:56:32 +00:00Commented Mar 24, 2013 at 18:56
-
Glad it worked, added my comment as an answer...root– root2013年03月24日 19:18:58 +00:00Commented Mar 24, 2013 at 19:18
1 Answer 1
You are using chars (curved quotes) encoded in windows-1252 that cannot be decoded because it's not valid utf-8. Replace the quotes and you are good to go.
answered Mar 24, 2013 at 19:17
root
81k25 gold badges111 silver badges120 bronze badges
Sign up to request clarification or add additional context in comments.
2 Comments
Pragyaditya Das
One small question, how did you know that the chars are encoded in
windows-1252? And your solution worked while I was working with PyQT4 :)Emile Bergeron
@PragyadityaDas Quotes are not for pre-formatted text, use code sample for that. I still accepted the edit because your intentions were good, I just improved it.
lang-py