Opened 12 years ago
Closed 12 years ago
#18459 closed Bug (invalid)
makemessages - problem with Unicode
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Normal | Keywords: | i18n, makemessages, unicode |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Commit 4a10308 from 2012-06-07 broke makemessages:
git checkout 4a10308
$ django-admin.py makemessages --all Traceback (most recent call last): File "/usr/bin/django-admin.py", line 7, in <module> execfile(__file__) File "/django/django/bin/django-admin.py", line 5, in <module> management.execute_from_command_line() File "/django/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/django/django/core/management/__init__.py", line 348, in execute version=get_version(), File "/django/django/__init__.py", line 7, in get_version return get_version(*args, **kwargs) File "/django/django/utils/version.py", line 25, in get_version git_changeset = get_git_changeset() File "/django/django/utils/version.py", line 46, in get_git_changeset timestamp = git_show.communicate()[0].partition('\n')[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 14535: ordinal not in range(128)
git checkout master (1a10a06)
$ django-admin.py makemessages --all processing language pt_BR UnicodeDecodeError: 'utf8' codec can't decode byte 0x96 in position 715460: invalid start byte
I've tried from __future__ import unicode_literals
but it didn't work.
I'm running Python 2.7.3 on Arch Linux x86_64
Change History (3)
follow-up: 2 comment:1 by , 12 years ago
comment:2 by , 12 years ago
Replying to claudep:
The first error you mention has been fixed in 90985048fc1882483794e6734eb91401aefbe768
For the second one, we'd need some more details. Try to increase verbosity (--verbosity=2).
Makemessages had some problems with 2 files in my static folder. One of them (list.txt) had the character "\u0096":
Text <96> Text Text Text
And the other was encoded using ISO-8859 (had latin words like "inglês" and "alemão").
The error with increased verbosity:
$ ../manage.py makemessages --all --verbosity 2 processing file list.txt in ./arquivos/static UnicodeDecodeError: 'utf8' codec can't decode byte 0x96 in position 5: invalid start byte
Converting those files to UTF-8 using native2ascii solved the problem.
comment:3 by , 12 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Thanks for looking closer at the error. So I will consider that the problem was on your side and close the ticket.
The first error you mention has been fixed in 90985048fc1882483794e6734eb91401aefbe768
For the second one, we'd need some more details. Try to increase verbosity (--verbosity=2).