Fix version detect of binaries on windows

This commit is contained in:
Ozzie Isaacs
2020-05-24 17:24:54 +02:00
parent cf10244f20
commit e4eab17595
3 changed files with 11 additions and 7 deletions

View File

@ -634,11 +634,12 @@ def check_unrar(unrarLocation):
unrarLocation = unrarLocation.encode(sys.getfilesystemencoding())
unrarLocation = [unrarLocation]
for lines in process_wait(unrarLocation):
value = re.search('UNRAR (.*) freeware', lines)
value = re.search('UNRAR (.*) freeware', lines, re.IGNORECASE)
if value:
version = value.group(1)
log.debug("unrar version %s", version)
except OSError as err:
break
except (OSError, UnicodeDecodeError) as err:
log.exception(err)
return _('Error excecuting UnRar')