Skip to content

Commit d2c256f

Browse files
committed
Write unsanitized filename
1 parent bdd5731 commit d2c256f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/test/test_pathlib/support/zip_path.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def teardown(self, root):
3636
root.zip_file.close()
3737

3838
def create_file(self, path, data=b''):
39-
path.zip_file.writestr(vfspath(path), data)
39+
zip_info = zipfile.ZipInfo(vfspath(path))
40+
zip_info.filename = vfspath(path) # Undo sanitization
41+
path.zip_file.writestr(zip_info, data)
4042

4143
def create_dir(self, path):
4244
zip_info = zipfile.ZipInfo(vfspath(path) + '/')

0 commit comments

Comments
 (0)