Jython 2.5.3b1中的ZipFile.open在哪里?

时间:2012-04-12 13:06:42

标签: jython

请观察:

PS Z:\dev\poc\SDR> jython.bat
Jython 2.5.3b1 (2.5:5fa0a5810b25, Feb 22 2012, 12:39:02)
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_27
Type "help", "copyright", "credits" or "license" for more information.
>>> from zipfile import ZipFile
>>> z=ZipFile('d:/ookla/us_aaa.zip')
>>> z.open
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: ZipFile instance has no attribute 'open'
>>> ZipFile.open
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: class ZipFile has no attribute 'open'
>>>

那么,open方法在哪里?

感谢。

1 个答案:

答案 0 :(得分:1)

它不可用。在Python 2.6中添加了ZipFile.open,但Jython仍处于2.5版本。

该方法已添加到Jython development repository

另见How to simulate ZipFile.open in Python 2.5?