Issue #9 new

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)

Jaap van Wingerde
created an issue

jaap@liakoster:/var/django/liakoster.nl/test2$ python manage.py dbgettext_export --traceback Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 222, in run_from_argv
self.execute(args, options.dict)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 255, in execute
output = self.handle(*args,
options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 385, in handle
return self.handle_noargs(
*options)
File "/usr/local/lib/python2.7/dist-packages/dbgettext/management/commands/dbgettext_export.py", line 84, in handle_noargs
self.gettext()
File "/usr/local/lib/python2.7/dist-packages/dbgettext/management/commands/dbgettext_export.py", line 120, in gettext
for s in parsed_gettext(obj, attr_name, export=True):
File "/usr/local/lib/python2.7/dist-packages/dbgettext/parser.py", line 115, in parsed_gettext
output.append(_(format) % params)
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/init.py", line 71, in ugettext
return _trans.ugettext(message) File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 276, in ugettext return do_translate(message, 'ugettext') File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 254, in do_translate result = getattr(t, translation_function)(eol_message) File "/usr/lib/python2.7/gettext.py", line 404, in ugettext return unicode(message) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128) jaap@liakoster:/var/django/liakoster.nl/test2$

Comments (2)

  1. Jaap van Wingerde reporter

    The new version has the same bug:

    jaap@liakoster:/var/django/liakoster.nl/test2$ sudo pip install --upgrade django-dbgettext Downloading/unpacking django-dbgettext from https://pypi.python.org/packages/source/d/django-dbgettext/django-dbgettext-0.1.1.tar.gz#md5=99f37c2606609031679ec0c0b5d6fc7c Downloading django-dbgettext-0.1.1.tar.gz Running setup.py egg_info for package django-dbgettext

    Installing collected packages: django-dbgettext Found existing installation: django-dbgettext 0.1 Uninstalling django-dbgettext: Successfully uninstalled django-dbgettext Running setup.py install for django-dbgettext

    Successfully installed django-dbgettext Cleaning up... jaap@liakoster:/var/django/liakoster.nl/test2$ python manage.py dbgettext_export --traceback Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 222, in run_from_argv self.execute(args, options.dict) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 255, in execute output = self.handle(*args, options) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 385, in handle return self.handle_noargs(*options) File "/usr/local/lib/python2.7/dist-packages/dbgettext/management/commands/dbgettext_export.py", line 93, in handle_noargs self.gettext() File "/usr/local/lib/python2.7/dist-packages/dbgettext/management/commands/dbgettext_export.py", line 129, in gettext for s in parsed_gettext(obj, attr_name, export=True): File "/usr/local/lib/python2.7/dist-packages/dbgettext/parser.py", line 115, in parsed_gettext output.append(_(format) % params) File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/init.py", line 71, in ugettext return _trans.ugettext(message) File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 276, in ugettext return do_translate(message, 'ugettext') File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 254, in do_translate result = getattr(t, translation_function)(eol_message) File "/usr/lib/python2.7/gettext.py", line 404, in ugettext return unicode(message) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128) jaap@liakoster:/var/django/liakoster.nl/test2$

  2. Jaap van Wingerde reporter

    This issue was caused by a faulty 'ï' in a field of the Django-MySQL-database. After overwriting the string with the same unicode string, the problem was solved. #!@%

  3. Log in to comment