7

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

ruakh
  • 175,680
  • 26
  • 273
  • 307
Elmer
  • 388
  • 2
  • 3
  • 13

1 Answers1

3

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.

root
  • 76,608
  • 25
  • 108
  • 120
  • 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 :) – Pragyaditya Das Oct 18 '16 at 19:46
  • 1
    @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. – Emile Bergeron Oct 18 '16 at 21:31