We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d015c2 commit 79a309fCopy full SHA for 79a309f
tests/test_path.py
@@ -571,3 +571,21 @@ def test_getinfo_missing(self, alpharep):
571
zipfile.Path(alpharep)
572
with self.assertRaises(KeyError):
573
alpharep.getinfo('does-not-exist')
574
+
575
+ @__import__('pytest').mark.skip(reason="infinite loop")
576
+ def test_malformed_paths(self):
577
+ """
578
+ Path should handle malformed paths.
579
580
+ data = io.BytesIO()
581
+ zf = zipfile.ZipFile(data, "w")
582
+ zf.writestr("/one-slash.txt", b"content")
583
+ zf.writestr("//two-slash.txt", b"content")
584
+ zf.writestr("../parent.txt", b"content")
585
+ zf.filename = ''
586
+ root = zipfile.Path(zf)
587
+ assert list(map(str, root.iterdir())) == [
588
+ 'one-slash.txt',
589
+ 'two-slash.txt',
590
+ 'parent.txt',
591
+ ]
0 commit comments