All format handlers compatible with python3 except chm

This commit is contained in:
Jean-Francois Dockes
2018-03-09 15:25:11 +01:00
parent 7f49de5d97
commit 93ac830079
13 changed files with 45 additions and 58 deletions
+8 -2
View File
@@ -80,9 +80,15 @@ class RarExtractor:
def openfile(self, params):
self.currentindex = -1
try:
self.rar = RarFile(params["filename:"])
# The previous versions passed the file name to
# RarFile. But the py3 version of this wants an str as
# input, which is wrong of course, as filenames are
# binary. Circumvented by passing the open file
f = open(params["filename:"], 'rb')
self.rar = RarFile(f)
return True
except:
except Exception as err:
self.em.rclog("RarFile: %s"%err)
return False
def getipath(self, params):