diff -r 3780973e4a25 django/core/management/commands/makemessages.py
a
|
b
|
|
66 | 66 | if domain == 'djangojs' and file.endswith('.js'): |
67 | 67 | if verbosity > 1: |
68 | 68 | sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) |
69 | | src = open(os.path.join(dirpath, file), "rb").read() |
| 69 | src = open(os.path.join(dirpath, file), "rU").read() |
70 | 70 | src = pythonize_re.sub('\n#', src) |
71 | | open(os.path.join(dirpath, '%s.py' % file), "wb").write(src) |
| 71 | open(os.path.join(dirpath, '%s.py' % file), "wt").write(src) |
72 | 72 | thefile = '%s.py' % file |
73 | 73 | cmd = 'xgettext -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % (domain, os.path.join(dirpath, thefile)) |
74 | 74 | (stdin, stdout, stderr) = os.popen3(cmd, 't') |
… |
… |
|
90 | 90 | elif domain == 'django' and (file.endswith('.py') or file.endswith('.html')): |
91 | 91 | thefile = file |
92 | 92 | if file.endswith('.html'): |
93 | | src = open(os.path.join(dirpath, file), "rb").read() |
| 93 | src = open(os.path.join(dirpath, file), "rU").read() |
94 | 94 | thefile = '%s.py' % file |
95 | | open(os.path.join(dirpath, thefile), "wb").write(templatize(src)) |
| 95 | open(os.path.join(dirpath, thefile), "wt").write(templatize(src)) |
96 | 96 | if verbosity > 1: |
97 | 97 | sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) |
98 | 98 | cmd = 'xgettext -d %s -L Python --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --keyword=ugettext_noop --keyword=ugettext_lazy --keyword=ungettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( |