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 c60394c commit 348a679Copy full SHA for 348a679
1 file changed
Lib/test/test_zipfile.py
@@ -2037,6 +2037,16 @@ def test_decompress_without_3rd_party_library(self):
2037
with zipfile.ZipFile(zip_file) as zf:
2038
self.assertRaises(RuntimeError, zf.extract, 'a.txt')
2039
2040
+ def test_reading_archive_member_starts_with_slash(self):
2041
+ member_path = '/folder/file.txt'
2042
+ member_data = b'hello world'
2043
+ with open(TESTFN, "wb") as f:
2044
+ f.write(member_data)
2045
+ with zipfile.ZipFile(TESTFN2, 'w') as zf:
2046
+ zf.write(TESTFN, member_path)
2047
+ with zipfile.ZipFile(TESTFN2) as zf:
2048
+ self.assertEqual(zf.read(member_path), member_data)
2049
+
2050
def tearDown(self):
2051
unlink(TESTFN)
2052
unlink(TESTFN2)
0 commit comments