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.

classification
Title: bugfix for [Bugs-850964](optparse)
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: gward Nosy List: fdrake, gward, quiver
Priority: normal Keywords: patch

Created on 2003-12-01 06:03 by quiver, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
optparse.py.patch quiver, 2003-12-01 06:03
Messages (2)
msg44981 - (view) Author: George Yoshida (quiver) (Python committer) Date: 2003-12-01 06:03
This is a bug fix for [Bugs-850964].
subject : optparse: OptionParser.__init__'s "prog"
http://www.python.org/sf/850964

I've changed get_usage, get_version, and error 
methods to use the instance variable, "prog", 
instead of calling get_prog_name() function directly.

This will display "prog" name if it was provided to 
OptionParser's constructor.
msg44982 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-04-01 07:47
Logged In: YES 
user_id=3066

While this looks good at first glance, it causes some tests
to fail in shallow ways.  I'll commit a similar patch
shortly that fixes the original problem without invalidating
existing tests.

Specifically, the existing tests expect that setting
sys.argv[0] after the OptionParser is constructed will
affect the expansion of the %prog token.  Testing self.prog
for a non-empty value at the time of expansion allows the
tests to pass.
History
Date User Action Args
2022-04-11 14:56:01adminsetgithub: 39635
2003-12-01 06:03:36quivercreate