Edgewall Software

Opened 9 years ago

Last modified 4 years ago

#12148 closed task

Replace uses of optparse with argparse — at Version 4

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.3.1
Component: general Version:
Severity: normal Keywords: python3
Cc: Branch:
Release Notes:

Replaced uses of optparse with argparse throughout codebase.

API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

Python has deprecated the optparse module and replaced it with argparse. The limited number of instances of optparse in the Trac codebase should be fairly easy to replace. optparse is deprecated in Python 2.7/3.2 and later.

Change History (4)

comment:1 by Ryan J Ollos, 9 years ago

Description: modified (diff)

comment:2 by Ryan J Ollos, 9 years ago

Description: modified (diff)

comment:3 by Ryan J Ollos, 8 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:4 by Ryan J Ollos, 8 years ago

Release Notes: modified (diff)

Proposed changes in log:rjollos.git:t12148_argparse:

A few of the subtleties with the changes are:

  • ArgumentParser.error returns exit code 2 in cases where exit code 1 was previously returned.
  • More could be done to improve htdigest.py, but I will save that for later, likely as part of #8361.
  • I haven't tested on Windows or Linux yet.
Note: See TracTickets for help on using tickets.