Closed Bug 775264 Opened 12 years ago Closed 12 years ago

[bedrock][traceback] UnicodeDecodeError: 'utf8' codec can't decode byte 0xee in position 0: invalid continuation byte

Categories

(www.mozilla.org :: General, defect)

defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stephend, Assigned: rik)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [sb-sprint-1] u=user c=L10N p=2)

http://www.mozilla.org/ku/firefox/14.0.1/whatsnew/ triggers the following traceback:

Traceback (most recent call last):

  File "/data/www/www.mozilla.org-django/bedrock/vendor/lib/python/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/data/www/www.mozilla.org-django/bedrock/vendor/lib/python/django/views/decorators/vary.py", line 22, in inner_func
    response = func(*args, **kwargs)

  File "/data/www/www.mozilla.org-django/bedrock/apps/firefox/views.py", line 76, in whatsnew_redirect
    {'locales_with_video': locales_with_video})

  File "/data/www/www.mozilla.org-django/bedrock/lib/l10n_utils/__init__.py", line 38, in render
    return jingo.render(request, template, context, **kwargs)

  File "/data/www/www.mozilla.org-django/bedrock/vendor/src/jingo/jingo/__init__.py", line 80, in render
    rendered = render_to_string(request, template, context)

  File "/data/www/www.mozilla.org-django/bedrock/vendor/src/jingo/jingo/__init__.py", line 98, in render_to_string
    return template.render(**get_context())

  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 891, in render
    return self.environment.handle_exception(exc_info, True)

  File "/data/www/www.mozilla.org-django/bedrock/apps/firefox/templates/firefox/whatsnew.html", line 1, in top-level template code
    {% extends "/firefox/base-resp.html" %}

  File "/data/www/www.mozilla.org-django/bedrock/apps/firefox/templates/firefox/base-resp.html", line 1, in top-level template code
    {% extends "base-resp.html" %}

  File "/data/www/www.mozilla.org-django/bedrock/templates/base-resp.html", line 10, in top-level template code
    <title>{% block page_title_prefix %}Mozilla — {% endblock %}{% block page_title %}{% endblock %}{% block page_title_suffix %} — mozilla.org{% endblock %}</title>

  File "/data/www/www.mozilla.org-django/bedrock/apps/firefox/templates/firefox/whatsnew.html", line 6, in block "page_title"
    {% block page_title %}{{ _('Welcome to Firefox') }}{% endblock %}

  File "/data/www/www.mozilla.org-django/bedrock/lib/l10n_utils/helpers.py", line 34, in _
    trans = translate(text, ctx['request'].langfiles)

  File "/data/www/www.mozilla.org-django/bedrock/lib/l10n_utils/dotlang.py", line 62, in translate
    trans = parse(path)

  File "/data/www/www.mozilla.org-django/bedrock/lib/l10n_utils/dotlang.py", line 26, in parse
    for line in lines:

  File "/usr/lib64/python2.6/codecs.py", line 684, in next
    return self.reader.next()

  File "/usr/lib64/python2.6/codecs.py", line 615, in next
    line = self.readline()

  File "/usr/lib64/python2.6/codecs.py", line 530, in readline
    data = self.read(readsize, firstline=True)

  File "/usr/lib64/python2.6/codecs.py", line 477, in read
    newchars, decodedbytes = self.decode(data, self.errors)

UnicodeDecodeError: 'utf8' codec can't decode byte 0xee in position 0: invalid continuation byte
Pascal: The error is in ku/main.lang. I don't know how but it has been messed up.
It looks like the file as a buggy unicode line in the middle , I am going to fix but we need to file a follow up bug, we can't have the parser choke on a unicode character it doesn't understand and put the whole locale down, it can be intellectually satisfying but for our day to day operations, that's a major functional regression compared to our PHP parser...
That's a fix on the .lang file but the proper fix should be in the parser, morphing this bug into a bedrock l10n bug
Blocks: bedrock-l10n
Summary: [traceback] UnicodeDecodeError: 'utf8' codec can't decode byte 0xee in position 0: invalid continuation byte → [bedrock][traceback] UnicodeDecodeError: 'utf8' codec can't decode byte 0xee in position 0: invalid continuation byte
(In reply to Pascal Chevrel:pascalc from comment #5)
> and the page is now back http://www.mozilla.org/ku/firefox/14.0.1/whatsnew/

Anything left to do here, then?  Can you take the bug and mark it fixed?
We have fixed the file encoding but the parser should have been able to process it or ignore it without breaking the whole app, I am lowering the priority but keep this bug as an l10n webdev bug to fix in the platform.
Severity: blocker → major
Whiteboard: [sb-sprint-1]
Assignee: nobody → anthony
Whiteboard: [sb-sprint-1] → [sb-sprint-1] u=user c=L10N p=2
So I worked on this a bit.

Pascal: Would you prefer the fallback to be something like:
F��licitations ! Votre Firefox a ��t�� mis �� jour.

or fallback to the English sentence?
I prefer the fallback with the black interrogation mark
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Verified FIXED on prod; thanks!
Status: RESOLVED → VERIFIED
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
You need to log in before you can comment on or make changes to this bug.