Skip to content
Permalink
Browse files

fix python error when using path with special chars in Processing/GRASS

  • Loading branch information
Giovanni Manghi
Giovanni Manghi committed Apr 26, 2015
1 parent 102f6d3 commit 80a65b9b1a57ecfd8bb15877e4907f99041cc521
@@ -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()
@@ -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()

@@ -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()
@@ -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()

0 comments on commit 80a65b9

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