From: Christopher Lenz Date: Wed, 5 Sep 2007 16:32:51 +0000 (+0000) Subject: Write PO files in binary mode. Closes #61. X-Git-Tag: 1.0~380 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cce3a53274858884fd5e3d7a75ca754f295ece82;p=thirdparty%2Fbabel.git Write PO files in binary mode. Closes #61. --- diff --git a/ChangeLog b/ChangeLog index ca2789e2..0e443c23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ http://svn.edgewall.org/repos/babel/tags/0.9.1/ `ngettext`, or vice versa. * Fixed time formatting for 12 am and 12 pm. * Fixed output encoding of the `pybabel --list-locales` command. + * PO files are now written in binary mode on windows (ticket #61). Version 0.9 diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py index 60a841c3..994effd9 100755 --- a/babel/messages/frontend.py +++ b/babel/messages/frontend.py @@ -162,7 +162,7 @@ class compile_catalog(Command): log.info('compiling catalog %r to %r', po_file, mo_file) - outfile = open(mo_file, 'w') + outfile = open(mo_file, 'wb') try: write_mo(outfile, catalog, use_fuzzy=self.use_fuzzy) finally: @@ -752,7 +752,7 @@ class CommandLineInterface(object): self.log.info('compiling catalog %r to %r', po_file, mo_file) - outfile = open(mo_file, 'w') + outfile = open(mo_file, 'wb') try: write_mo(outfile, catalog, use_fuzzy=options.use_fuzzy) finally: