Closed Bug 1541576 Opened 7 months ago Closed 7 months ago

Saving XML translations fails with non-ascii characters

Categories

(Webtools :: Pontoon, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mathjazz, Assigned: mathjazz)

Details

Attachments

(1 file)

This is a regression from:
https://github.com/mozilla/pontoon/commit/33c0af08af7e260172329bdb28de44f74dc41393#diff-e1db8dec79ce203dbd9c3652d31b2c53L139

Traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/views/decorators/http.py", line 40, in inner
    return func(request, *args, **kwargs)
  File "/app/pontoon/base/utils.py", line 288, in wrap
    return f(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py", line 185, in inner
    return func(*args, **kwargs)
  File "/app/pontoon/base/views.py", line 771, in update_translation
    use_ttk_checks,
  File "/app/pontoon/checks/libraries/__init__.py", line 32, in run_checks
    cl_checks = compare_locales.run_checks(entity, locale_code, string)
  File "/app/pontoon/checks/libraries/compare_locales.py", line 196, in run_checks
    string,
  File "/app/pontoon/checks/libraries/compare_locales.py", line 147, in cast_to_compare_locales
    translation=string,
UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-5: ordinal not in range(128)
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.