Django

Code

Ticket #4899: ticket-4899.2.diff

File ticket-4899.2.diff, 1.8 kB (added by Ramiro Morales, 1 year ago)
  • django/bin/make-messages.py

    old new  
    8484                    thefile = '%s.py' % file 
    8585                    cmd = 'xgettext %s -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( 
    8686                        os.path.exists(potfile) and '--omit-header' or '', domain, os.path.join(dirpath, thefile)) 
    87                     (stdin, stdout, stderr) = os.popen3(cmd, 'b') 
     87                    (stdin, stdout, stderr) = os.popen3(cmd, 't') 
    8888                    msgs = stdout.read() 
    8989                    errors = stderr.read() 
    9090                    if errors: 
     
    101101                    thefile = file 
    102102                    if file.endswith('.html'): 
    103103                        src = open(os.path.join(dirpath, file), "rb").read() 
    104                         open(os.path.join(dirpath, '%s.py' % file), "wb").write(templatize(src)) 
    105104                        thefile = '%s.py' % file 
     105                        open(os.path.join(dirpath, thefile), "wb").write(templatize(src)) 
    106106                    if verbose: sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) 
    107107                    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"' % ( 
    108108                        domain, os.path.join(dirpath, thefile)) 
    109                     (stdin, stdout, stderr) = os.popen3(cmd, 'b') 
     109                    (stdin, stdout, stderr) = os.popen3(cmd, 't') 
    110110                    msgs = stdout.read() 
    111111                    errors = stderr.read() 
    112112                    if errors: