self.assertEqual(zf.filelist[0].filename, "foo.txt")
self.assertEqual(zf.filelist[1].filename, "\xf6.txt")
+ def test_read_after_write_unicode_filenames(self):
+ with zipfile.ZipFile(TESTFN2, 'w') as zipfp:
+ zipfp.writestr('приклад', b'sample')
+ self.assertEqual(zipfp.read('приклад'), b'sample')
+
def test_exclusive_create_zip_file(self):
"""Test exclusive creating a new zipfile."""
unlink(TESTFN2)
# strong encryption
raise NotImplementedError("strong encryption (flag bit 6)")
- if zinfo.flag_bits & 0x800:
+ if fheader[_FH_GENERAL_PURPOSE_FLAG_BITS] & 0x800:
# UTF-8 filename
fname_str = fname.decode("utf-8")
else: