--- a/i18n.py Tue Feb 14 15:14:22 2012 +0100
+++ b/i18n.py Tue Jul 10 15:07:23 2012 +0200
@@ -33,7 +33,7 @@
output = open(output_file, 'w')
for filepath in files:
for match in re.finditer('i18n:(content|replace)="([^"]+)"', open(filepath).read()):
- print >> output, '_("%s")' % match.group(2)
+ output.write('_("%s")' % match.group(2))
output.close()
@@ -60,7 +60,9 @@
status != 0
"""
from subprocess import call
- print cmd.replace(os.getcwd() + os.sep, '')
+ # use getcwdu as cmd may be unicode and cwd may contains non-ascii
+ # characters
+ print cmd.replace(os.getcwdu() + os.sep, '')
status = call(cmd, shell=True)
if status != 0:
raise Exception('status = %s' % status)