Skip to content

Commit c801c50

Browse files
committed
Merge pull request #1976 from radosuav/otb_double_quotes
[processing] avoid consecutive quotes when calling OTB algorithms
2 parents 33d973f + f94d92f commit c801c50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/plugins/processing/algs/otb/OTBUtils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
__revision__ = '$Format:%H$'
3030

3131
import os
32+
import re
3233
from PyQt4.QtCore import QCoreApplication
3334
from qgis.core import QgsApplication
3435
import subprocess
@@ -130,7 +131,7 @@ def executeOtb(commands, progress):
130131
loglines = []
131132
loglines.append(OTBUtils.tr("OTB execution console output"))
132133
os.putenv('ITK_AUTOLOAD_PATH', OTBUtils.otbLibPath())
133-
fused_command = ''.join(['"%s" ' % c for c in commands])
134+
fused_command = ''.join(['"%s" ' % re.sub(r'^"|"$', '', c) for c in commands])
134135
proc = subprocess.Popen(fused_command, shell=True, stdout=subprocess.PIPE, stdin=open(os.devnull),stderr=subprocess.STDOUT, universal_newlines=True).stdout
135136
for line in iter(proc.readline, ""):
136137
if "[*" in line:

0 commit comments

Comments
 (0)