[Python-Dev] Problems with unicode_literals (original) (raw)
Victor Stinner victor.stinner at haypocalc.com
Sat Jan 17 14:03:13 CET 2009
- Previous message: [Python-Dev] Problems with unicode_literals
- Next message: [Python-Dev] Problems with unicode_literals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Le Saturday 17 January 2009 04:45:28 Barry Warsaw, vous avez écrit :
The optparse one could easily be fixed for 2.6, if we agree it should be fixed. This untested patch should do it I think:
Index: Lib/optparse.py =================================================================== --- Lib/optparse.py (revision 68465) +++ Lib/optparse.py (working copy) @@ -994,7 +994,7 @@ """addoption(Option) addoption(optstr, ..., kwarg=val, ...) """ - if type(args[0]) is types.StringType: + if type(args[0]) in types.StringTypes: option = self.optionclass(*args, **kwargs) elif len(args) == 1 and not kwargs: option = args[0]
See also related issues:
- http://bugs.python.org/issue2931: optparse: various problems with unicode and gettext
- http://bugs.python.org/issue4319: optparse and non-ascii help strings
-- Victor Stinner aka haypo http://www.haypocalc.com/blog/
- Previous message: [Python-Dev] Problems with unicode_literals
- Next message: [Python-Dev] Problems with unicode_literals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]