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 @@ > """add_option(Option) > add_option(opt_str, ..., kwarg=val, ...) > """ > - if type(args[0]) is types.StringType: > + if type(args[0]) in types.StringTypes: > option = self.option_class(*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/ _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com