Steven Bethard <steven.beth...@gmail.com> added the comment:

Are you sure this is an argparse issue, and not a terminal issue? Here's what I 
see:

>>> parser = argparse.ArgumentParser(description=u'Rus Рус')
>>> print(parser.description)
Rus Рус
>>> sys.stderr.write(parser.description)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-6: 
ordinal not in range(128)
>>> parser.format_help()
u'usage: [-h]\n\nRus \u0420\u0443\u0441\n\noptional arguments:\n  -h, --help  
show this help message and exit\n'
>>> sys.stderr.write(parser.format_help())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode characters in position 17-19: 
ordinal not in range(128)

To me, it looks like sys.stderr doesn't like the unicode, even though at the 
interactive prompt I can print things okay.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9779>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to