diff -r c4f7a0ba29e1 -r 82b3a2dbbc90 django/core/management/commands/makemessages.py
--- a/django/core/management/commands/makemessages.py	Fri Aug 08 20:06:28 2008 -0300
+++ b/django/core/management/commands/makemessages.py	Sat Aug 09 10:26:01 2008 -0300
@@ -97,10 +97,10 @@
             if domain == 'djangojs' and file_ext == '.js':
                 if verbosity > 1:
                     sys.stdout.write('processing file %s in %s\n' % (file, dirpath))
-                src = open(os.path.join(dirpath, file), "rb").read()
+                src = open(os.path.join(dirpath, file), "rU").read()
                 src = pythonize_re.sub('\n#', src)
-                open(os.path.join(dirpath, '%s.py' % file), "wb").write(src)
                 thefile = '%s.py' % file
+                open(os.path.join(dirpath, thefile), "w").write(src)
                 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))
                 (stdin, stdout, stderr) = os.popen3(cmd, 't')
                 msgs = stdout.read()
@@ -121,9 +121,9 @@
             elif domain == 'django' and (file_ext == '.py' or file_ext in extensions):
                 thefile = file
                 if file_ext in extensions:
-                    src = open(os.path.join(dirpath, file), "rb").read()
+                    src = open(os.path.join(dirpath, file), "rU").read()
                     thefile = '%s.py' % file
-                    open(os.path.join(dirpath, thefile), "wb").write(templatize(src))
+                    open(os.path.join(dirpath, thefile), "w").write(templatize(src))
                 if verbosity > 1:
                     sys.stdout.write('processing file %s in %s\n' % (file, dirpath))
                 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"' % (
