From 39712d03f3c58a5f6b3f67f5042e3d74fd409d19 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 19 Feb 2019 20:53:49 +0100 Subject: [PATCH] rclrar: only decode the ipath if it's not str already --- src/filters/rclrar | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/filters/rclrar b/src/filters/rclrar index ebaf221d..8889d70c 100755 --- a/src/filters/rclrar +++ b/src/filters/rclrar @@ -62,7 +62,8 @@ class RarExtractor: try: if using_unrar: - ipath = ipath.decode('UTF-8') + if type(ipath) == type(b''): + ipath = ipath.decode('UTF-8') rarinfo = self.rar.getinfo(ipath) # dll.hpp RHDF_DIRECTORY: 0x20 isdir = ((rarinfo.flag_bits & 0x20) != 0) @@ -70,7 +71,8 @@ class RarExtractor: rarinfo = self.rar.getinfo(ipath) isdir = rarinfo.isdir() except Exception as err: - self.em.rclog("extractone: rar.getinfo failed: [%s]" % err) + self.em.rclog("extractone: using_unrar %d rar.getinfo failed: [%s]" + % (using_unrar,err)) return (True, docdata, ipath, False) if not isdir: