This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bluebird
Recipients bluebird, georg.brandl
Date 2009-02-09.13:23:10
SpamBayes Score 4.5408122e-13
Marked as misclassified No
Message-id <1234185792.84.0.378540305485.issue5190@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation of optparse mentions make_option() as the standard way 
to create an option list:

For example, in the doc of python 2.5:

====
14.3.3.2 Populating the parser 

[...]
pass it an Option instance (as returned by make_option()) 

[...]

option_list = [
    make_option("-f", "--filename",
                action="store", type="string", dest="filename"),
    make_option("-q", "--quiet",
                action="store_false", dest="verbose"),
    ]


(make_option() is a factory function for creating Option instances; 
currently it is an alias for the Option constructor. A future version of 
optparse may split Option into several classes, and make_option() will 
pick the right class to instantiate. Do not instantiate Option 
directly.) 
===============

However, make_option is not part of the function exported in the __all__ 
list of optparse. Strangely enough, this does not prevent to use 
make_option() in regular python scripts, but it does not work when 
packaging a python application, for example with pyinstaller.

The problem is also present in python 2.6

The fix is either to update the documentation to use Option() directly 
or to add make_option to __all__
History
Date User Action Args
2009-02-09 13:23:12bluebirdsetrecipients: + bluebird, georg.brandl
2009-02-09 13:23:12bluebirdsetmessageid: <1234185792.84.0.378540305485.issue5190@psf.upfronthosting.co.za>
2009-02-09 13:23:11bluebirdlinkissue5190 messages
2009-02-09 13:23:10bluebirdcreate