#33205: call_command() fails when required mutually exclusive arguments use the
same `dest`.
-------------------------------------+-------------------------------------
Reporter: Peter Law | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* cc: Hasan Ramezani (added)
* type: Uncategorized => Bug
* component: Uncategorized => Core (Management commands)
* stage: Unreviewed => Accepted
Comment:
Thanks for the report. The following calls work as expected for me :
{{{#!python
management.call_command('pause', '--until=1')
management.call_command('pause', '--until', '1')
management.call_command('pause', '--for=1')
management.call_command('pause', '--for', '1')
}}}
however I confirmed an issue when passing arguments in keyword arguments:
{{{
management.call_command('pause', until='1')
management.call_command('pause', **{'for': '1'}) # Using
"call_command('pause', for='1')" raises SyntaxError
}}}
This is caused by using `dest` for mapping `**options` to arguments, see
[https://github.com/django/django/blob/e2f778d57947d168a875159e6df075255eea4bbc/django/core/management/__init__.py#L117-L121
call_command()].
--
Ticket URL: <https://code.djangoproject.com/ticket/33205#comment:1>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.f324cb2301c7ffd3548747fab4a31eeb%40djangoproject.com.