diff options
author | Alex Morega <alex@grep.ro> | 2013-07-07 10:57:12 +0200 |
---|---|---|
committer | Alex Morega <alex@grep.ro> | 2013-07-07 10:57:12 +0200 |
commit | 7bcbab276346d3555ff9917cf25ee6d1ed352967 (patch) | |
tree | 60bbaec8946c6d35e9ceeaa99efaf8ccba027a64 /tests | |
parent | 48cba25f2c662c76797282c6c823ef18a387d07a (diff) | |
download | babel-7bcbab276346d3555ff9917cf25ee6d1ed352967.tar.gz |
open po files in binary mode
Diffstat (limited to 'tests')
-rw-r--r-- | tests/messages/test_frontend.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/messages/test_frontend.py b/tests/messages/test_frontend.py index 7f76342..882cb00 100644 --- a/tests/messages/test_frontend.py +++ b/tests/messages/test_frontend.py @@ -543,11 +543,11 @@ msgstr[0] "" long_message = '"'+ 'xxxxx '*15 + '"' - with open('project/i18n/messages.pot', 'U') as f: - pot_contents = f.read() + with open('project/i18n/messages.pot', 'rb') as f: + pot_contents = f.read().decode('latin-1') pot_with_very_long_line = pot_contents.replace('"bar"', long_message) with open(self.cmd.input_file, 'wb') as f: - f.write(pot_with_very_long_line) + f.write(pot_with_very_long_line.encode('latin-1')) self.cmd.no_wrap = True self.cmd.finalize_options() @@ -602,11 +602,11 @@ msgstr[1] "" long_message = '"'+ 'xxxxx '*15 + '"' - with open('project/i18n/messages.pot', 'U') as f: - pot_contents = f.read() + with open('project/i18n/messages.pot', 'rb') as f: + pot_contents = f.read().decode('latin-1') pot_with_very_long_line = pot_contents.replace('"bar"', long_message) with open(self.cmd.input_file, 'wb') as f: - f.write(pot_with_very_long_line) + f.write(pot_with_very_long_line.encode('latin-1')) self.cmd.width = 120 self.cmd.finalize_options() self.cmd.run() |