EOF while scanning triple-quoted string literal

Rhodri James rhodri at wildebst.demon.co.uk
Mon Oct 11 17:59:32 EDT 2010


On Mon, 11 Oct 2010 10:37:09 +0100, bussiere bussiere <bussiere at gmail.com>
wrote:

> i've looked on the web and here but i didn't find an answer : here is my
> code
>
> zlib.decompress("""
> xワᆳヤ=ラᄇHナs~Ʀᄑç\ムîà
> Z@ÑÁÔQÇlxÇÆïPP~ýVãì゙M6ÛÐ|ê֭ᄁᄂヤ=)}éÓUe﬿ö3ᄎᄌú"}ʿïÿ÷1þ8ñ́U÷ᄏñíLÒVi:`ᄈᄎL!Ê҆p6-%Fë^ヘ÷à,Q.K!ユô`ÄA!ÑêweÌ
> ÊÚAロYøøÂjôóᅠÂcñ䊧fᆴùテúN
> :nüzAÝ7%ᄌcdUタᄌ3ôPۂタlンyHᆲᄑ$/yzᄒíàヌ'ÕÓ&`|S!<'ᄂ÷Zļᄐ2ホモ;ニ(ÅÛfb!úü$ナテᄒ,9ßhàPᄎᄄێフÑbØὛホQᄍ-Ü}(n;ᄄホLヤ\^ï9ᆭᄍラDdВéÞ|åPOGᄂÐÙ%â&AÔë)ÎTÐC
> ᄐïc枢í%Èï!フᄋëiq*ᄌVKÐNᄡ[ᄁfOq{OᆭÆÊ,0GᄂリmtツᄈOᄌΥ$#îヘqbYᄆメUニᄉÞáP`
> ヨ×ᆵÃPwaレǩâ×)ハFcêÚ=!Åöᄊ
> )AFñᄈ/cMᄃ!NóNΈór?pàÜòXw
> Bvæ0ïçIÉoマ>5pᆭ-ØWÚNᄆùFᄆØPçÃþdᅠ;ル1[Oᄈホ~6ツᄈᆬŕìᄄޠ=øð@ネV﾿ᄅ)÷%ユÜib{HᄆKŅVlDCテîfÑWì÷ìáár.ワîv﾿<dᄎn~ú*ÁÕ7ýá}EsYᆵWᄂÈ:R×ãQңメ?Ø1vヘäツ~èR1ᄉÜ*ᄡónAᆬjmNoツユᄈÌښᆬf[8ᆭÛ>゙OWラ|ÌbDᄁÖ녡M=Ð÷èâミム'ÂÝÐ
> ;ë mᄎQÂäԤۢ:モᄆdᄎᄑLȂ1ᄈ_÷YZᆲNòÛ
> â\ロxÐlݵᆵムᆱøm5Ëá=ïoÍlMᆪ[×#Ypᅠトx[ÉÊyæツoモナz)ᆭᄀÝÏìò
>
> """)
>
> 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.


-- 
Rhodri James *-* Wildebeest Herder to the Masses



More information about the Python-list mailing list