Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix python error when using path with special chars in Processing/GRASS
  • Loading branch information
Giovanni Manghi committed Apr 26, 2015
1 parent 102f6d3 commit 80a65b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/grass/GrassUtils.py
Expand Up @@ -165,7 +165,7 @@ def createGrassScript(commands):
output.write('g.gisenv.exe set="GISDBASE=' + gisdbase + '"\n')
output.write('g.gisenv.exe set="GRASS_GUI=text"\n')
for command in commands:
output.write(command + '\n')
output.write(command.encode('utf8') + '\n')
output.write('\n')
output.write('exit\n')
output.close()
Expand All @@ -174,7 +174,7 @@ def createGrassScript(commands):
def createGrassBatchJobFileFromGrassCommands(commands):
fout = codecs.open(GrassUtils.grassBatchJobFilename(), 'w', encoding='utf-8')
for command in commands:
fout.write(command + '\n')
fout.write(command.encode('utf8') + '\n')
fout.write('exit')
fout.close()

Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/grass7/Grass7Utils.py
Expand Up @@ -163,7 +163,7 @@ def createGrass7Script(commands):
output.write('g.gisenv.exe set="GISDBASE=' + gisdbase + '"\n')
output.write('g.gisenv.exe set="GRASS_GUI=text"\n')
for command in commands:
output.write(command + '\n')
output.write(command.encode('utf8') + '\n')
output.write('\n')
output.write('exit\n')
output.close()
Expand All @@ -172,7 +172,7 @@ def createGrass7Script(commands):
def createGrass7BatchJobFileFromGrass7Commands(commands):
fout = open(Grass7Utils.grassBatchJobFilename(), 'w')
for command in commands:
fout.write(command + '\n')
fout.write(command.encode('utf8') + '\n')
fout.write('exit')
fout.close()

Expand Down

0 comments on commit 80a65b9

Please sign in to comment.