Roundup Tracker - Issues

Issue 2551195

classification
Replace optparse (deprecated in python 3.2) with argparse
Type: Severity: normal
Components: Versions:
process
Status: fixed fixed
:
: schlatterbeck : rouilj, schlatterbeck
Priority: : Deprecation, Effort-Low, StarterTicket

Created on 2022-02-06 19:58 by rouilj, last changed 2022-11-24 18:04 by rouilj.

Messages
msg7451 Author: [hidden] (rouilj) Date: 2022-02-06 19:58
Per PEP594 (https://python.github.io/peps/pep-0594/)
optparse is listed as deprecated as of python 3.2.
It is not scheduled for removal yet, but the following code uses it:

scripts/schema-dump.py:from optparse import OptionParser
scripts/imapServer.py:import optparse

these scripts should use argparse.
msg7663 Author: [hidden] (schlatterbeck) Date: 2022-11-22 13:34
I've ported these scripts to argparse (and pushed the result) after some rudimentary testing. Note that the yaml output of schema-dump.py was already broken, it tries to split a string on '<' assigning the result to a 2-tuple resulting in a ValueError. May very well be that this works with the standard schema, though.

Let me know if we can close this (and open another issue for the yaml error? Unfortunately I don't know enough about the rudimentary parser implemented here to fix this.
msg7674 Author: [hidden] (rouilj) Date: 2022-11-24 18:04
Hi Ralf:

I have closed this and opened another issue for fixing the yaml parser: issue2551243.

I can't reproduce your error, but I'll have a new copy of the script checked in
in a few. Followup on the new issue.
History
Date User Action Args
2022-11-24 18:04:14rouiljsetstatus: open -> fixed
assignee: schlatterbeck
messages: + msg7674
2022-11-22 13:34:20schlatterbecksetstatus: new -> open
resolution: fixed
messages: + msg7663
nosy: + schlatterbeck
2022-02-06 19:59:42rouiljsetkeywords: + Deprecation
2022-02-06 19:58:34rouiljcreate