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 Sean.Wang
Recipients Sean.Wang, akuchling, aronacher, ash, bethard, eric.araujo, ezio.melotti, gward, ivilata, loewis, sampablokuper, vstinner
Date 2016-01-21.08:22:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1453364547.59.0.107297265589.issue2931@psf.upfronthosting.co.za>
In-reply-to
Content
when an unicode option.default_value could not be ascii encoded, it would throw exception, detailed logs below:
  File "/Users/seanwang/Documents/dev/foo/bar.py", line 119, in main
    parser.print_help()
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 1670, in print_help
    file.write(self.format_help().encode(encoding, "replace"))
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 1650, in format_help
    result.append(self.format_option_help(formatter))
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 1630, in format_option_help
    result.append(OptionContainer.format_option_help(self, formatter))
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 1074, in format_option_help
    result.append(formatter.format_option(option))
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 316, in format_option
    help_text = self.expand_default(option)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 288, in expand_default
    return option.help.replace(self.default_tag, str(default_value))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)
History
Date User Action Args
2016-01-21 08:22:27Sean.Wangsetrecipients: + Sean.Wang, loewis, akuchling, gward, bethard, ivilata, vstinner, aronacher, ezio.melotti, ash, eric.araujo, sampablokuper
2016-01-21 08:22:27Sean.Wangsetmessageid: <1453364547.59.0.107297265589.issue2931@psf.upfronthosting.co.za>
2016-01-21 08:22:27Sean.Wanglinkissue2931 messages
2016-01-21 08:22:27Sean.Wangcreate