Mercurial > babel > old > mirror
changeset 549:12d5425fb430
babel.messages.pofile should only apply encoding when actually writing a file (eases Python 3 transition, closes #251)
author | fschwarz |
---|---|
date | Sat, 19 Mar 2011 19:50:21 +0000 |
parents | dde86441b508 |
children | 3c306c1f842f |
files | babel/messages/pofile.py |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/babel/messages/pofile.py +++ b/babel/messages/pofile.py @@ -382,12 +382,11 @@ updating the catalog """ def _normalize(key, prefix=''): - return normalize(key, prefix=prefix, width=width) \ - .encode(catalog.charset, 'backslashreplace') + return normalize(key, prefix=prefix, width=width) def _write(text): if isinstance(text, unicode): - text = text.encode(catalog.charset) + text = text.encode(catalog.charset, 'backslashreplace') fileobj.write(text) def _write_comment(comment, prefix=''):