Opened 10 years ago
Closed 10 years ago
#22702 closed Bug (duplicate)
Management command options can be parsed twice.
Reported by: | mardini | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Under some circumstances, a management command option can be parsed twice, here's an example (I'm aware that --version
can be called alone):
$ python manage.py runserver --version 1.8.dev20140524142208 1.8.dev20140524142208
After a quick look, there seems to be two places in core/management/__init__.py
where commands options are parsed, both in ManagementUtility.execute()
:
# First time, via LaxOptionParser() options, args = parser.parse_args(self.argv) # Second time self.fetch_command(subcommand).run_from_argv(self.argv)
I think there should be a check to make sure that once a command option is run, it won't be parsed again.
Note:
See TracTickets
for help on using tickets.
This is probably a duplicate of #11407. Reopen if you think it's not the case.