Message258739
This bug still exists in Python 2.7.10 with optparse version 1.5.3.
When the default_value is not ASCII encoded, it would raise `UnicodeEncodeError: 'ascii' codec can't encode characters`
this error is due to the `str` usage in `expand_default` method:
def expand_default(self, option):
if self.parser is None or not self.default_tag:
return option.help
default_value = self.parser.defaults.get(option.dest)
if default_value is NO_DEFAULT or default_value is None:
default_value = self.NO_DEFAULT_VALUE
return option.help.replace(self.default_tag, str(default_value)) |
|
Date |
User |
Action |
Args |
2016-01-21 08:01:36 | Sean.Wang | set | recipients:
+ Sean.Wang, loewis, akuchling, gward, bethard, ivilata, vstinner, aronacher, ezio.melotti, ash, eric.araujo, sampablokuper |
2016-01-21 08:01:36 | Sean.Wang | set | messageid: <1453363296.52.0.208084180874.issue2931@psf.upfronthosting.co.za> |
2016-01-21 08:01:36 | Sean.Wang | link | issue2931 messages |
2016-01-21 08:01:36 | Sean.Wang | create | |
|