2015-04-30 27 views
2

根據zlib模塊的Python documentationdecompressobj對象具有copy()函數來克隆解壓縮程序的狀態。對於StackOverflow here上的壓縮端也提到了此等效功能。Python中的zlib decompressobj缺少.copy()

然而,當我嘗試使用它,它根本不存在:

C:\>C:\Python27\python.exe 
Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import zlib 
>>> meow = zlib.decompressobj() 
>>> purr = meow.copy() 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
AttributeError: copy 

這是Python中的錯誤嗎?我試圖尋找這個主題,但太多的錯誤命中。

+0

按照Linux上Python 2.7.8和3.3.0的文檔中的描述工作。有人可以確認Windows上的行爲嗎? –

+0

在Linux和Windows 2.7.9上都能正常工作(不會拋出attrib錯誤),所以無論它是什麼原因 - 它最有可能與你的盒子中的東西有關。 –

回答

0

沒關係。這是一個known bug,已在2.7的新版本中修復。我只需要檢查錯誤列表。出於某種原因,谷歌沒有索引該錯誤頁面。