1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-15 07:37:40 +00:00

Fix error unclosed IO on external binary version query

This commit is contained in:
Ozzie Isaacs
2021-07-11 09:19:46 +02:00
parent 87f07003f4
commit f8de7e75cc
3 changed files with 15 additions and 12 deletions

View File

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