Issue1441

classification
Title: ZipFile.writestr("path", "content") doesn't work
Type: Severity: normal
Components: Versions:
Milestone:
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, pekarna, pjenvey
Priority: Keywords:

Created on 2009-08-17.22:46:28 by pekarna, last changed 2009-08-26.04:25:00 by pjenvey.

Messages
msg5055 (view) Author: Ondřej Žižka (pekarna) Date: 2009-08-17.22:46:28
ZipFile.writestr("path", "content") doesn't work.
Try this example in Python, then in Jython:

import zipfile

z = zipfile.ZipFile("test.zip","w",zipfile.ZIP_DEFLATED)
z.writestr("../test","test zip content")
z.close()
msg5065 (view) Author: Philip Jenvey (pjenvey) Date: 2009-08-26.04:25:00
Works for me:

(jython)pjenvey@golgo13:/tmp$ /usr/bin/python ziptest.py 
(jython)pjenvey@golgo13:/tmp$ unzip test.zip
Archive:  test.zip
warning:  skipped "../" path component(s) in ../test
  inflating: test                    
(jython)pjenvey@golgo13:/tmp$ ls -la test.zip test
----------  1 pjenvey  wheel   16 Aug 25 21:22 test
-rw-r--r--  1 pjenvey  wheel  130 Aug 25 21:22 test.zip
(jython)pjenvey@golgo13:/tmp$ rm !:2-$
rm test.zip test
override ---------  pjenvey/wheel for test? y
(jython)pjenvey@golgo13:/tmp$ jython ziptest.py 
(jython)pjenvey@golgo13:/tmp$ unzip test.zip
Archive:  test.zip
warning:  skipped "../" path component(s) in ../test
  inflating: test                    
(jython)pjenvey@golgo13:/tmp$ ls -al test.zip test
----------  1 pjenvey  wheel   16 Aug 25 21:23 test
-rw-r--r--  1 pjenvey  wheel  130 Aug 25 21:23 test.zip
History
Date User Action Args
2009-08-26 04:25:00pjenveysetstatus: open -> closed
resolution: invalid
messages: + msg5065
nosy: + pjenvey
2009-08-18 01:38:00fwierzbickisetnosy: + fwierzbicki
2009-08-17 22:46:28pekarnacreate