Skip to content

Commit 42e30b6

Browse files
authoredNov 27, 2018
Merge pull request #8557 from juanmpd/patch-1
Update Grass7Utils.py. Fixes #20632 #20502
2 parents 6cc41a9 + 31f3f69 commit 42e30b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎python/plugins/processing/algs/grass7/Grass7Utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,11 @@ def executeGrass(commands, feedback, outputCommands=None):
400400
# commands again.
401401
if not grassOutDone and outputCommands:
402402
command, grassenv = Grass7Utils.prepareGrassExecution(outputCommands)
403+
# For MS-Windows, we need to hide the console window.
404+
if isWindows():
405+
si = subprocess.STARTUPINFO()
406+
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
407+
si.wShowWindow = subprocess.SW_HIDE
403408
with subprocess.Popen(
404409
command,
405410
shell=False,
@@ -408,6 +413,7 @@ def executeGrass(commands, feedback, outputCommands=None):
408413
stderr=subprocess.STDOUT,
409414
universal_newlines=True,
410415
env=grassenv,
416+
encoding="cp{}".format(Grass7Utils.getWindowsCodePage()) if isWindows() else None,
411417
startupinfo=si if isWindows() else None
412418
) as proc:
413419
for line in iter(proc.stdout.readline, ''):

0 commit comments

Comments
 (0)
Please sign in to comment.