This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author thorsten
Recipients thorsten
Date 2011-05-26.22:53:39
SpamBayes Score 1.324213e-11
Marked as misclassified No
Message-id <1306450420.84.0.782316559531.issue12193@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2011-05-26 22:53:40thorstensetrecipients: + thorsten
2011-05-26 22:53:40thorstensetmessageid: <1306450420.84.0.782316559531.issue12193@psf.upfronthosting.co.za>
2011-05-26 22:53:40thorstenlinkissue12193 messages
2011-05-26 22:53:39thorstencreate