[issue8841] GetoptError strings should be localized

Filip Gruszczyński report at bugs.python.org
Tue Mar 1 23:08:47 CET 2011


Filip Gruszczyński <gruszczy at gmail.com> added the comment:

I'd be happy to provide a patch.

How about extending getopt api to something like this:

>> optlist, args = getopt.getopt(['-b'], 'e', not_recognized="no %s option, mate!")
GetoptError: no -b option, mate!

Or maybe you should provide a dictionary?

>> optlist, args = getopt.getopt(['-b'], 'e', errors={'not_recognized': "no %s option, mate!")
GetoptError: no -b option, mate!

I have little experience with making design decisions, so if someone could guide me here, I will get down and provide a patch with proposed solution.

----------
nosy: +gruszczy

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8841>
_______________________________________


More information about the Python-bugs-list mailing list