On this page
optparse.OptionValueError
Prev: optparse.OptionParser | Up: optparse | Next: optparse.OptParseError
Rel: optparse.BadOptionError, optparse.check_choice, optparse.HelpFormatter, optparse.IndentedHelpFormatter
Ref: docs.python.org โ optparse.OptionValueError
Tags: #public #python3 #stdlib #optparse
Import
import optparse
from optparse import OptionValueError
Signature & Overview
optparse.OptionValueError(msg)
Raised if an invalid option value is encountered on the command line.
Methods & Attributes
OptionValueError.add_note(self, note, /)โ Add a note to the exceptionOptionValueError.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import optparse
assert issubclass(optparse.OptionValueError, optparse.OptParseError)
Gotchas
- Raise inside custom
optparsetype-checker callbacks on invalid values.
REPL Inspect
from optparse import OptionValueError
help(OptionValueError)
Linked from
Related notes
- tuts/python3/stdlib_module/optparse/OptionParser Linked here; links to this page; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/OptParseError Linked here; links to this page; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/optparse/BadOptionError Linked here; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/check_choice Linked here; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/HelpFormatter Linked here; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/IndentedHelpFormatter Linked here; shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/make_option shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/Option shared tags: #optparse, #stdlib
- tuts/python3/stdlib_module/optparse/OptionConflictError shared tags: #optparse, #stdlib