[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly
Changes by Kuba Wieczorek faw...@gmail.com: Removed file: http://bugs.python.org/file12420/zipfile_extract_dirs_r2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4710 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly
Kuba Wieczorek faw...@gmail.com added the comment: Here is a revised version of the patch with directories support for write(). It works like UNIX zip program so if a directory path is passed to the function, it stores only the directory itself (without the contents). This time without tests as well because I don't want to mess up with them until I finish my patch completely. Added file: http://bugs.python.org/file12433/zipfile_dirs_support.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4710 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly
Changes by Kuba Wieczorek faw...@gmail.com: Removed file: http://bugs.python.org/file12433/zipfile_dirs_support.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4710 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly
Changes by Kuba Wieczorek faw...@gmail.com: Added file: http://bugs.python.org/file12435/zipfile_dirs_support.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4710 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly
New submission from Kuba Wieczorek faw...@gmail.com: This behaviour has been known of course for quite long time. I suppose this is not intentional so I've played a bit with this and I hope you'll consider some little change. Currently, if a ZIP archive contains some subdirectories then zipfile.ZipFile.extract()/extractall() will create files instead of directories in the target location. This of course will lead some scripts to crash (unless any work-around has been done) because files from the subdirectories couldn't be created. Attached is a patch against current 2.7 tree. Applied, will make extractall() extract properly all the contents of the archive with proper tree structure. If a directory name is passed to the extract(), it will only create the directory itself without the contents (I guess it is obvious). -- components: Library (Lib) files: zipfile_extract_dirs.patch keywords: patch messages: 78143 nosy: faw severity: normal status: open title: [PATCH] zipfile.ZipFile does not extract directories properly type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file12413/zipfile_extract_dirs.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4710 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly
Kuba Wieczorek faw...@gmail.com added the comment: I'm not sure if it would make sense to save current extract()/extractall() behaviour and implement new with another function because current one is simply faulty. And if it's about BC breaks then well... it may be introduced in 3.0 line, I think that leaving faulty behaviour and introducing another with another function misses the point. AFAIK there'd be no problem with Windows-style paths but to be sure I revised my patch. Yes, I'm sorry for the lack of tests, it is my first patch and I forgot about this. I'll write them in a couple of hours. Added file: http://bugs.python.org/file12420/zipfile_extract_dirs_r2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4710 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com