2015-06-17 41 views
2
Traceback (most recent call last): 
    File "TTRC_main.py", line 309, in <module> 
    updater.start() 
    File "TTRC_main.py", line 36, in start 
    newFileData = bz2.BZ2File("C:/Program Files (x86)/Toontown Rewritten/temp/phase_7.mf.bz2"," rb").read() 
IOError: invalid data stream 

來檢索文件我收到代碼的給我這個錯誤是:的Python BZ2 IO錯誤:無效的數據流

newFileComp = urllib.URLopener() 
newFileComp.retrieve("http://kcmo-1.download.toontownrewritten.com/content/phase_7.mf.bz2", "C:/Program Files (x86)/Toontown Rewritten/temp/phase_7.mf.bz2") 

我該怎麼做才能解決這個問題?它不是真正的描述。 (對我來說)

回答

2

由於extra space處於文件模式,是否會發生該問題? -

newFileData = bz2.BZ2File("C:/Program Files (x86)/Toontown Rewritten/temp/phase_7.mf.bz2"," rb").read() 

試試這個 -

newFileData = bz2.BZ2File("C:/Program Files (x86)/Toontown Rewritten/temp/phase_7.mf.bz2","rb").read()