Skip to content

Commit 80a65b9

Browse files
author
Giovanni Manghi
committedApr 26, 2015
fix python error when using path with special chars in Processing/GRASS
1 parent 102f6d3 commit 80a65b9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎python/plugins/processing/algs/grass/GrassUtils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def createGrassScript(commands):
165165
output.write('g.gisenv.exe set="GISDBASE=' + gisdbase + '"\n')
166166
output.write('g.gisenv.exe set="GRASS_GUI=text"\n')
167167
for command in commands:
168-
output.write(command + '\n')
168+
output.write(command.encode('utf8') + '\n')
169169
output.write('\n')
170170
output.write('exit\n')
171171
output.close()
@@ -174,7 +174,7 @@ def createGrassScript(commands):
174174
def createGrassBatchJobFileFromGrassCommands(commands):
175175
fout = codecs.open(GrassUtils.grassBatchJobFilename(), 'w', encoding='utf-8')
176176
for command in commands:
177-
fout.write(command + '\n')
177+
fout.write(command.encode('utf8') + '\n')
178178
fout.write('exit')
179179
fout.close()
180180

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def createGrass7Script(commands):
163163
output.write('g.gisenv.exe set="GISDBASE=' + gisdbase + '"\n')
164164
output.write('g.gisenv.exe set="GRASS_GUI=text"\n')
165165
for command in commands:
166-
output.write(command + '\n')
166+
output.write(command.encode('utf8') + '\n')
167167
output.write('\n')
168168
output.write('exit\n')
169169
output.close()
@@ -172,7 +172,7 @@ def createGrass7Script(commands):
172172
def createGrass7BatchJobFileFromGrass7Commands(commands):
173173
fout = open(Grass7Utils.grassBatchJobFilename(), 'w')
174174
for command in commands:
175-
fout.write(command + '\n')
175+
fout.write(command.encode('utf8') + '\n')
176176
fout.write('exit')
177177
fout.close()
178178

0 commit comments

Comments
 (0)
Please sign in to comment.