cpython: d02507c9f973 (original) (raw)

Mercurial > cpython

changeset 83282:d02507c9f973 2.7

Issue #17656: Fix extraction of zip files with unicode member paths. [#17656]

Serhiy Storchaka storchaka@gmail.com
date Sat, 13 Apr 2013 12:28:17 +0300
parents 1062c66e9bdc
children d5e5017309b1
files Lib/test/test_zipfile.py Lib/zipfile.py Misc/NEWS
diffstat 3 files changed, 26 insertions(+), 2 deletions(-)[+] [-] Lib/test/test_zipfile.py 21 Lib/zipfile.py 5 Misc/NEWS 2

line wrap: on

line diff

--- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -18,7 +18,7 @@ from tempfile import TemporaryFile from random import randint, random from unittest import skipUnless -from test.test_support import TESTFN, run_unittest, findfile, unlink +from test.test_support import TESTFN, TESTFN_UNICODE, run_unittest, findfile, unlink TESTFN2 = TESTFN + "2" TESTFNDIR = TESTFN + "d" @@ -424,6 +424,25 @@ class TestsWithSourceFile(unittest.TestC with open(filename, 'rb') as f: self.assertEqual(f.read(), content)

+

+

+

+ def test_extract_hackers_arcnames(self): hacknames = [ ('../foo/bar', 'foo/bar'),

--- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -1053,7 +1053,10 @@ class ZipFile(object): if os.path.sep == '\': # filter illegal characters on Windows illegal = ':<>|"?*'

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -22,6 +22,8 @@ Core and Builtins Library ------- +- Issue #17656: Fix extraction of zip files with unicode member paths. +