#24969: Backwards compatibility for optparse in management commands broken for
overrides.
-------------------------------------+-------------------------------------
Reporter: paul-butcher | Owner: nobody
Type: Uncategorized | Status: closed
Component: Core (Management | Version: 1.8
commands) | Resolution:
Severity: Normal | worksforme
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by paul-butcher):
Replying to [comment:2 claudep]:
> I think the workaround is to customize the `create_parser` method
instead of fiddling with `option_list`.
> I commented on the original report
(https://github.com/gabrielfalcao/lettuce/issues/480#issuecomment-111247247).
Changes to option parsing in derived classes should ideally update them to
use the modern argparse mechanism, rather than to keep alive the
deprecated optparse mechanism. I'm sure that eventually, all the various
authors of management commands will get around to updating them. In the
case of lettuce, where the problem was spotted, I may well do so myself if
no-one else beats me to it.
However, as it stands, upgrading Django causes some optparse-based
management commands to stop working, which is what I meant by "Backwards
compatibility ... broken".
If this is a desired behaviour, aimed at providing a stronger nudge than a
Deprecation Warning, then that is fine (though one might argue that the
optparse stuff should just be removed, if that's the case), but then this
probably becomes a documentation issue, where the "Default options" are
now "Built-in" or "Compulsory" options.
--
Ticket URL: <https://code.djangoproject.com/ticket/24969#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.d4d3befd439ec3ef2775265b457ba42f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.