Unicode Hell

Jeff Epler jepler at unpythonic.net
Thu Nov 13 09:20:54 EST 2003


On Thu, Nov 13, 2003 at 04:02:57PM +0200, Stuart Forsyth wrote:
>        print a.encode('utf-8)
[...]
> EOL while scanning single-quoted string
> 
> Do you know what this means? 

Yes.  Make sure your program is valid Python.

    print a.encode('utf-8')
Add this character       ^

However, this is the error Python would give for the code you had in
your message, so the error must come from something besides the Python
tokenizer/parser:
>>> print a.encode('utf-8)
  File "<stdin>", line 1
    print a.encode('utf-8)
                         ^
SyntaxError: invalid token

Jeff





More information about the Python-list mailing list