Changed the args to subprocess.Popen to pass args to the command

Before the command was not working correctly to check the calibre version since it seemed to be treating the entire string as the command.  So when ' --version' was added it was breaking.  I changed the format to pass the command and args as a list and it seems to work correctly.
This commit is contained in:
Ben Bennett 2018-07-23 11:53:44 -04:00
parent 2449b4049b
commit b271b5f686

View File

@ -34,7 +34,7 @@ def versionCalibre():
versions = _(u'not installed') versions = _(u'not installed')
if os.path.exists(ub.config.config_converterpath): if os.path.exists(ub.config.config_converterpath):
try: try:
p = subprocess.Popen(ub.config.config_converterpath + ' --version', stdout=subprocess.PIPE, stderr=subprocess.PIPE) p = subprocess.Popen([ub.config.config_converterpath, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.wait() p.wait()
for lines in p.stdout.readlines(): for lines in p.stdout.readlines():
if isinstance(lines, bytes): if isinstance(lines, bytes):