You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace Deprecated optparse with argparse for Command-Line Parsing #142
The current implementation of pyfiglet utilizes the optparse module for parsing command-line arguments.
However, optparse has been deprecated since Python 3.2 in favor of the more powerful and flexible argparse module.
Proposed Changes:
Switch to argparse: Replace all instances of optparse with argparse to handle command-line arguments.
Thanks; bear in mind I may be slow to respond since I'll have a lot going on. If it turns out to be non-trivial to review the requests it may take some time. Please feel free to ping the thread every so often if I go silent.
As optparse is no longer deprecated I'll close this, but thanks anyway for the suggestion.
If anyone does come up with a good reason to migrate option parsers in the future I would only seriously consider it if it left the option parsing compatible with older versions (i.e. supporting flags as they are used with older versions). I would be reluctant to accidentally change the behaviour of existing scripts.
Activity
pwaller commentedon Dec 30, 2024
If someone wants to contribute this, pull requests are welcome.
yy214123 commentedon Dec 30, 2024
Thank you for the positive response!
I will proceed to create a Pull Request to replace
optparsewithargparse.pwaller commentedon Dec 30, 2024
Thanks; bear in mind I may be slow to respond since I'll have a lot going on. If it turns out to be non-trivial to review the requests it may take some time. Please feel free to ping the thread every so often if I go silent.
stefanor commentedon Dec 30, 2024
FYI, optparse got undeprecated: python/cpython#126227
yy214123 commentedon Dec 30, 2024
Thank you for sharing the information. I didn't notice this news.
pwaller commentedon Aug 15, 2025
As optparse is no longer deprecated I'll close this, but thanks anyway for the suggestion.
If anyone does come up with a good reason to migrate option parsers in the future I would only seriously consider it if it left the option parsing compatible with older versions (i.e. supporting flags as they are used with older versions). I would be reluctant to accidentally change the behaviour of existing scripts.