From b271b5f686780457e2501b53ae79935bbc9b9b6b Mon Sep 17 00:00:00 2001 From: Ben Bennett Date: Mon, 23 Jul 2018 11:53:44 -0400 Subject: [PATCH] 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. --- cps/converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/converter.py b/cps/converter.py index ff4f252c..aa8bd411 100644 --- a/cps/converter.py +++ b/cps/converter.py @@ -34,7 +34,7 @@ def versionCalibre(): versions = _(u'not installed') if os.path.exists(ub.config.config_converterpath): 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() for lines in p.stdout.readlines(): if isinstance(lines, bytes):