Fix directory commands on packed files

This commit is contained in:
shortcutme 2019-03-29 02:26:50 +01:00
parent 41cd7da5bd
commit 9fbf4771f2
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -7,7 +7,6 @@ from Plugin import PluginManager
from Config import config
from Debug import Debug
# Keep archive open for faster reponse times for large sites
archive_cache = {}
@ -119,6 +118,8 @@ class SiteStoragePlugin(object):
if not result:
raise Exception("Unable to download file")
file_obj = self.site.storage.openBigfile(inner_path)
if file_obj == False:
file_obj = None
try:
archive = openArchive(archive_path, file_obj=file_obj)
@ -188,7 +189,7 @@ class SiteStoragePlugin(object):
if archive_inner_path.endswith(".zip"):
return archive.open(path_within).read()
else:
return archive.extractfile(path_within.encode("utf8")).read()
return archive.extractfile(path_within).read()
else:
return super(SiteStoragePlugin, self).read(inner_path, mode)