{{{
from django.core.management import call_command
call_command('dumpdata', 'asdf', indent=2, output=filePath)
}}}
fails with {{{ Unable to serialize database: 'ascii' codec can't encode
character '\xdf' in position 83: ordinal not in range(128). }}}
running {{{ python3 manage.py dumpdata --indent=2 --output=dump.json.gz
asdf }}} from the command line works fine though!
why won't it work with {{{call_command()}}}?
----
- python version: {{{3.6.9}}}
- django version: {{{3.2.13}}}
- {{{$LANG}}} is set to {{{en_US.UTF-8}}}
- {{{$LC_ALL}}} is set to {{{en_US.UTF-8}}}
- {{{$LC_CTYPE}}} is set to {{{UTF-8}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33847>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
This is almost certainly a locale issue — are those `$LANG` vars really
being set in a script environment? 🤔
See (e.g.) #15017, #20572, #32439 (and links therein) for some historical
issues in this area.
You'll need to debug yourself, or provide a minimal test project that
reproduces the issue.
Happy to reopen to look if you can provide such.
--
Ticket URL: <https://code.djangoproject.com/ticket/33847#comment:1>