Message28693
Unicode strings with non-ascii chars in generate a
UnicodeEncodeError
File "/usr/lib/python2.3/optparse.py", line 1370, in
print_help
file.write(self.format_help())
UnicodeEncodeError: 'ascii' codec can't encode
characters in position 200-202:
+ordinal not in range(128)
I'm subclassing OptionParser and adds the following
method to get it to work. Should something like this be
done for python 2.5?
def print_help(self, file=None):
if file is None:
file = sys.stdout
file.write(self.format_help().encode(file.encoding,
'replace'))
Tom Cato |
|
Date |
User |
Action |
Args |
2007-08-23 14:40:20 | admin | link | issue1498146 messages |
2007-08-23 14:40:20 | admin | create | |
|