Mercurial > babel > mirror
changeset 547:1631d555d7e4 trunk
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 | fd3bda2d3d34 |
children | 5e08905fe812 |
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=''):