From 4259aa69dfd92cd4c813fb06b31e6d85e8903dda Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Wed, 26 Apr 2017 19:39:45 +0100 Subject: [PATCH] Get rid of shel=true again --- cps/helper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cps/helper.py b/cps/helper.py index 33ac980e..fd004eda 100755 --- a/cps/helper.py +++ b/cps/helper.py @@ -66,9 +66,9 @@ def make_mobi(book_id, calibrepath): vendorpath = os.path.join(os.path.normpath(os.path.dirname(os.path.realpath(__file__)) + os.sep + "../vendor" + os.sep)) if sys.platform == "win32": - kindlegen = os.path.join(vendorpath, u"kindlegen.exe") + kindlegen = (os.path.join(vendorpath, u"kindlegen.exe")).encode(sys.getfilesystemencoding()) else: - kindlegen = os.path.join(vendorpath, u"kindlegen") + kindlegen = (os.path.join(vendorpath, u"kindlegen")).encode(sys.getfilesystemencoding()) if not os.path.exists(kindlegen): app.logger.error("make_mobi: kindlegen binary not found in: %s" % kindlegen) return None @@ -80,8 +80,8 @@ def make_mobi(book_id, calibrepath): file_path = os.path.join(calibrepath, book.path, data.name) if os.path.exists(file_path + u".epub"): - p = subprocess.Popen((kindlegen + " \"" + file_path + u".epub\"").encode(sys.getfilesystemencoding()), - stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True ) + p = subprocess.Popen([kindlegen, ("\"" + file_path + u".epub\"").encode(sys.getfilesystemencoding())], + stdout=subprocess.PIPE, stderr=subprocess.PIPE ) # Poll process for new output until finished while True: nextline = p.stdout.readline()