Message25039
| Author |
ahmado |
| Recipients |
| Date |
2005年04月15日.19:39:32 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
When using the "callback" action, optparse requires
that you STILL specify a "dest" parameter, though it is
not required or used by the option parser.
In fact, if you do not include the "dest" parameter, your
options will still work properly, but optparse will
generate an exception when calling the "--help" option.
Not specifying a "dest" parameter will result in the
following Exception when using the default "--help" or "-
h" option:
File "c:\Python23\lib\optparse.py", line 229, in
format_option_strings
metavar = option.metavar or option.dest.upper()
AttributeError: 'NoneType' object has no attribute 'upper'
<workaround>
by simply adding a bogus bug, the --help / -h option
works properly even though the dest isn't actually used.
</workaround>
|
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 14:31:04 | admin | link | issue1183972 messages |
| 2007年08月23日 14:31:04 | admin | create |
|