New submission from Thorsten Kampe <thors...@thorstenkampe.de>: Error with argparse and UTF-8 non-ASCII help text on Linux (works on Windows and on Linux with optparse):
% LANG=de_De ./script.py --help Traceback (most recent call last): File "./script.py", line 26, in <module> args = cmdlineparser.parse_args() File "/usr/lib/python2.7/argparse.py", line 1678, in parse_args args, argv = self.parse_known_args(args, namespace) File "/usr/lib/python2.7/argparse.py", line 1710, in parse_known_args namespace, args = self._parse_known_args(args, namespace) File "/usr/lib/python2.7/argparse.py", line 1916, in _parse_known_args start_index = consume_optional(start_index) File "/usr/lib/python2.7/argparse.py", line 1856, in consume_optional take_action(action, args, option_string) File "/usr/lib/python2.7/argparse.py", line 1784, in take_action action(self, namespace, argument_values, option_string) File "/usr/lib/python2.7/argparse.py", line 993, in __call__ parser.print_help() File "/usr/lib/python2.7/argparse.py", line 2303, in print_help self._print_message(self.format_help(), file) File "/usr/lib/python2.7/argparse.py", line 2317, in _print_message file.write(message) UnicodeEncodeError: 'ascii' codec can't encode character u'\xdc' in position 91: ordinal not in range(128) ---------- components: Unicode files: script.py messages: 137013 nosy: thorsten priority: normal severity: normal status: open title: Argparse does not work together with gettext and non-ASCII help text versions: Python 2.7 Added file: http://bugs.python.org/file22138/script.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12193> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com