Skip to content
Permalink
Browse files

[processing] Fix exceptions on grass algorithms on Windows

(cherry picked from commit 9b61eb8)
  • Loading branch information
juanmpd authored and nyalldawson committed Dec 4, 2018
1 parent 2e6ebb0 commit 0c36b90eafc80e4b6bfe7091b9c07ecf80afc744
Showing with 6 additions and 0 deletions.
  1. +6 −0 python/plugins/processing/algs/grass7/Grass7Utils.py
@@ -400,6 +400,11 @@ def executeGrass(commands, feedback, outputCommands=None):
# commands again.
if not grassOutDone and outputCommands:
command, grassenv = Grass7Utils.prepareGrassExecution(outputCommands)
# For MS-Windows, we need to hide the console window.
if isWindows():
si = subprocess.STARTUPINFO()
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
si.wShowWindow = subprocess.SW_HIDE
with subprocess.Popen(
command,
shell=False,
@@ -408,6 +413,7 @@ def executeGrass(commands, feedback, outputCommands=None):
stderr=subprocess.STDOUT,
universal_newlines=True,
env=grassenv,
encoding="cp{}".format(Grass7Utils.getWindowsCodePage()) if isWindows() else None,
startupinfo=si if isWindows() else None
) as proc:
for line in iter(proc.stdout.readline, ''):

0 comments on commit 0c36b90

Please sign in to comment.
You can’t perform that action at this time.