You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fix for issue #6 enables something like my test case in that issue to work - specifying paths within a .zip file works regardless of the case of the path within the .zip file, at least when I provide the path using the same case as appears in the .zip file:
However, it doesn't work if I specify a path in the wrong case:
>>> zip.open('/testdir/upper').read()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "[...]/site-packages/fs/base.py", line 1224, in open
bin_file = self.openbin(path, mode=bin_mode, buffering=buffering)
File "[...]/site-packages/fs/archive/zipfs/__init__.py", line 217, in openbin
raise errors.ResourceNotFound(path)
fs.errors.ResourceNotFound: resource '/testdir/upper' not found
despite this claim that the filesystem is not case-sensitive:
it is possible the archive came from a system where case does matter and the archive could include both Bar and bar as separate files in the archive.
The Python 3.6.13 zipfile module's documentation doesn't say anything about case, but at least in Python 3.6.8 the module seems to be similarly case-sensitive.
I think then that the bug is just that zip.getmeta()["case_insensitive"] returns True when it should return False.
Incidentally fs.zipfs.ReadZipFS which comes with PyFilesystem has the same bug. I'll try to get around to filing a bug against that package too.
The text was updated successfully, but these errors were encountered:
Thanks for the report, i forgot to change this but indeed #6 has shown that Zip files were not case insensitive. I'm actually doing some work on Pyfilesystem2 at the moment including a refactoring of the _ZipExtFile to use the seeking mechanism provided by CPython instead of our hack on Python3.7+, so I'll patch this bug as the same time.
Thanks very much! I actually use PyFilesystem's .zip file handling rather than fs.archive's (due to issue #3), and I found this bug by accident when trying to investigate a problem in PyFilesystem - I imported the wrong module and used the wrong class - so you fixed the bug that actually matters to me.
The fix for issue #6 enables something like my test case in that issue to work - specifying paths within a .zip file works regardless of the case of the path within the .zip file, at least when I provide the path using the same case as appears in the .zip file:
However, it doesn't work if I specify a path in the wrong case:
despite this claim that the filesystem is not case-sensitive:
The Info-ZIP
zip
manual page suggests that .zip files are in fact case-sensitive:The Python 3.6.13
zipfile
module's documentation doesn't say anything about case, but at least in Python 3.6.8 the module seems to be similarly case-sensitive.I think then that the bug is just that
zip.getmeta()["case_insensitive"]
returnsTrue
when it should returnFalse
.Incidentally
fs.zipfs.ReadZipFS
which comes with PyFilesystem has the same bug. I'll try to get around to filing a bug against that package too.The text was updated successfully, but these errors were encountered: