Mercurial > babel > old > babel-test
changeset 267:044a47d2f020
Default the encoding of output by the `pybabel --list-locales` command to ASCII with errors replaced, if the output stream has no encoding set. For a reason unknown to me I got an encoding error, but only when when running the output through a pipe on the shell.
author | cmlenz |
---|---|
date | Wed, 22 Aug 2007 09:33:47 +0000 |
parents | 35c8a87a9839 |
children | 4fb303dfd27a |
files | babel/messages/frontend.py |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/babel/messages/frontend.py +++ b/babel/messages/frontend.py @@ -631,7 +631,8 @@ format = u'%%-%ds %%s' % (longest + 1) for identifier in localedata.list(): locale = Locale.parse(identifier) - print format % (identifier, locale.english_name) + output = format % (identifier, locale.english_name) + print output.encode(sys.stdout.encoding or 'ascii', 'replace') return 0 if not args: