Ticket #7084: t7084_post_r7844.diff

File t7084_post_r7844.diff, 1.9 KB (added by Ramiro Morales, 16 years ago)
  • django/core/management/commands/makemessages.py

    diff -r 3780973e4a25 django/core/management/commands/makemessages.py
    a b  
    6666            if domain == 'djangojs' and file.endswith('.js'):
    6767                if verbosity > 1:
    6868                    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()
    7070                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)
    7272                thefile = '%s.py' % file
    7373                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))
    7474                (stdin, stdout, stderr) = os.popen3(cmd, 't')
     
    9090            elif domain == 'django' and (file.endswith('.py') or file.endswith('.html')):
    9191                thefile = file
    9292                if file.endswith('.html'):
    93                     src = open(os.path.join(dirpath, file), "rb").read()
     93                    src = open(os.path.join(dirpath, file), "rU").read()
    9494                    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))
    9696                if verbosity > 1:
    9797                    sys.stdout.write('processing file %s in %s\n' % (file, dirpath))
    9898                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"' % (
Back to Top