2.2a1: django-admin migrate throws UnicodeEncodeError

27 views
Skip to first unread message

Axel Rau

unread,
Feb 1, 2019, 1:49:07 PM2/1/19
to Django users
Hi,

File "/usr/local/py_venv/erdb2-django/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 266, in migration_progress_callback
self.stdout.write(" Applying %s\u2026" % migration, ending="")
File "/usr/local/py_venv/erdb2-django/lib/python3.6/site-packages/django/core/management/base.py", line 145, in write
self._out.write(style_func(msg))
UnicodeEncodeError: 'ascii' codec can't encode character '\u2026' in position 48: ordinal not in range(128)

Should stdout not receive ASCII only?

Someone changed here 3 dots to ellipsis character:
https://github.com/django/django/commit/50b8493581fea3d7137dd8db33bac7008868d23a#diff-e835ddfb52774b39749788a0d046e477

Axel
---
PGP-Key:29E99DD6 ☀ computing @ chaos claudius

Tim Graham

unread,
Feb 1, 2019, 3:45:39 PM2/1/19
to Django users
I think your shell/terminal isn't configured for Unicode. Take a look here for some ideas about how to solve it: https://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20/39293287

Tim Graham

unread,
Feb 12, 2019, 6:00:52 PM2/12/19
to Django users
This was reported as crashing on Windows in https://code.djangoproject.com/ticket/30184 so we might revert the change.
Reply all
Reply to author
Forward
0 new messages