summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2015-10-03 09:58:36 +0200
committerClaude Paroz <claude@2xlibre.net>2015-10-03 14:40:33 +0200
commit3f22e83e90bc2eeea5f65858660385a34fbf5486 (patch)
tree644c57eeded9626f64e5ef1af00abc63715e8d1e /django
parentfa2e1e633ac2073906ed3f1f32107d02331107aa (diff)
Fixed #25483 -- Allowed passing non-string arguments to call_command
Thanks KS Chan for the report and Tim Graham for the review.
Diffstat (limited to 'django')
-rw-r--r--django/core/management/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
index 7e4982f0a2..eb49cce375 100644
--- a/django/core/management/__init__.py
+++ b/django/core/management/__init__.py
@@ -16,6 +16,7 @@ from django.core.management.base import (
from django.core.management.color import color_style
from django.utils import autoreload, lru_cache, six
from django.utils._os import npath, upath
+from django.utils.encoding import force_text
def find_commands(management_dir):
@@ -106,7 +107,7 @@ def call_command(name, *args, **options):
for s_opt in parser._actions if s_opt.option_strings
}
arg_options = {opt_mapping.get(key, key): value for key, value in options.items()}
- defaults = parser.parse_args(args=args)
+ defaults = parser.parse_args(args=[force_text(a) for a in args])
defaults = dict(defaults._get_kwargs(), **arg_options)
# Move positional args out of options to mimic legacy optparse
args = defaults.pop('args', ())