| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 87ac08d commit d1eca1e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3296,39 +3296,6 @@ def test_malformed_paths(self): | |||
| 3296 | 3296 | assert list(map(str, root.iterdir())) == ['../'] | |
| 3297 | 3297 | assert root.joinpath('..').joinpath('parent.txt').read_bytes() == b'content' | |
| 3298 | 3298 | ||
| 3299 | - def test_unsupported_names(self): | ||
| 3300 | - """ | ||
| 3301 | - Path segments with special characters are readable. | ||
| 3302 | - | ||
| 3303 | - On some platforms or file systems, characters like | ||
| 3304 | - ``:`` and ``?`` are not allowed, but they are valid | ||
| 3305 | - in the zip file. | ||
| 3306 | - """ | ||
| 3307 | - data = io.BytesIO() | ||
| 3308 | - zf = zipfile.ZipFile(data, "w") | ||
| 3309 | - zf.writestr("path?", b"content") | ||
| 3310 | - zf.writestr("V: NMS.flac", b"fLaC...") | ||
| 3311 | - zf.filename = '' | ||
| 3312 | - root = zipfile.Path(zf) | ||
| 3313 | - contents = root.iterdir() | ||
| 3314 | - assert next(contents).name == 'path?' | ||
| 3315 | - item = next(contents) | ||
| 3316 | - assert item.name == 'V: NMS.flac', item.name | ||
| 3317 | - assert root.joinpath('V: NMS.flac').read_bytes() == b"fLaC..." | ||
| 3318 | - | ||
| 3319 | - def test_backslash_not_separator(self): | ||
| 3320 | - """ | ||
| 3321 | - In a zip file, backslashes are not separators. | ||
| 3322 | - """ | ||
| 3323 | - data = io.BytesIO() | ||
| 3324 | - zf = zipfile.ZipFile(data, "w") | ||
| 3325 | - zf.writestr(DirtyZipInfo.for_name("foo\\bar", zf), b"content") | ||
| 3326 | - zf.filename = '' | ||
| 3327 | - root = zipfile.Path(zf) | ||
| 3328 | - (first,) = root.iterdir() | ||
| 3329 | - assert not first.is_dir() | ||
| 3330 | - assert first.name == 'foo\\bar', first.name | ||
| 3331 | - | ||
| 3332 | 3299 | ||
| 3333 | 3300 | class DirtyZipInfo(zipfile.ZipInfo): | |
| 3334 | 3301 | """ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments