EOF while scanning triple-quoted string literal
ian.g.kelly at gmail.com
Tue Oct 12 00:23:52 CEST 2010
On Mon, Oct 11, 2010 at 3:59 PM, Rhodri James
<rhodri at wildebst.demon.co.uk>wrote:
> On Mon, 11 Oct 2010 10:37:09 +0100, bussiere bussiere <bussiere at gmail.com>
> i've looked on the web and here but i didn't find an answer : here is my
>> ;ë mﾺQÂäԤۢ:ﾓﾱdﾺﾽLȂ1ﾳ_÷YZﾬNòÛ
>> so it was a string that i got by zlib.compress an other string. How can i
>> decompress this string ?
> It helps to say what your problem is more explicitly than just hinting at
> it in the title. Assuming that you are running on Windows and the Python
> traceback really does single this line out, my guess is that one of those
> random binary characters is a Ctrl-Z. Windows regards that as the end of a
> text file. How you get out of that one, I'm not sure, but frankly putting
> arbitrary binary into a literal string is rather asking for something like
> this to come and bite you.
Option 1: Replace the binary bytes with the proper escape codes
(incidentally, I see some backslashes already in there that most likely also
need to be escaped).
Option 2: Move that ugly mess out of the source and into an auxiliary data
Option 3: Encode it in base64 and add a decoding step before the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list