Opened 4 years ago

Last modified 4 years ago

#31868 closed Bug

Plural forms expression could be dangerous — at Initial Version

Reported by: Paul Owned by: nobody
Component: Internationalization Version: 3.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Somewhere around the end of July 2020, this error started occurring with my website. The code has not been changed for ages, except for several translations added in the .po file.
The Latin .po file was added two years ago. Everything had been working fine until last week, when 500 errors started bumping for any Latin po file usage (i.e. translation.activate('la')).
I’ve tried:

  1. Reverting to the early-July version of the .po files;
  2. Removing the ‘Plural Forms’ line from the .po files;
  3. Removing the .po files at all.

This does not help at all. The only thing which eliminates the issue is setting i18N = False in settings.py.

Here is the complete traceback:

Traceback:

File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/core/handlers/exception.py" in inner

  1. response = get_response(request)


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/core/handlers/base.py" in _legacy_get_response

  1. response = self._get_response(request)


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/core/handlers/base.py" in _get_response

  1. response = self.process_exception_by_middleware(e, request)


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/core/handlers/base.py" in _get_response

  1. response = wrapped_callback(request, *callback_args, callback_kwargs)


File "/home/robbit/webapps/django_tran_bot/tran_bot/core/decorators.py" in _view

  1. response = view_func(request, *args, kwargs)


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/views/generic/base.py" in view

  1. return self.dispatch(request, *args, kwargs)


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/views/generic/base.py" in dispatch

  1. return handler(request, *args, kwargs)


File "/home/robbit/webapps/django_tran_bot/tran_bot/translation/views.py" in get

  1. for_extension=request.is_ajax())


File "/home/robbit/webapps/django_tran_bot/tran_bot/translation/manager.py" in find_translations

  1. if can_sort_translations or (not trans in related and not trans.from_word_form.for_link_str in related_links):


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/utils/functional.py" in get

  1. res = instance.dict[self.name] = self.func(instance)


File "/home/robbit/webapps/django_tran_bot/tran_bot/word/models/base.py" in for_link_str

  1. return strip_tags(unicode(self))


File "/home/robbit/webapps/django_tran_bot/tran_bot/word/mixins.py" in str

  1. return parse_markdown(main_field_value, self.lang())


File "/home/robbit/webapps/django_tran_bot/tran_bot/core/utils/html.py" in parse_markdown

  1. with translation.override('uk' if to_lang else from_lang):


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/utils/translation/init.py" in enter

  1. activate(self.language)


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/utils/translation/init.py" in activate

  1. return _trans.activate(language)


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/utils/translation/trans_real.py" in activate

  1. _active.value = translation(language)


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/utils/translation/trans_real.py" in translation

  1. _translations[language] = DjangoTranslation(language)


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/utils/translation/trans_real.py" in init

  1. self._add_installed_apps_translations()


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/utils/translation/trans_real.py" in _add_installed_apps_translations

  1. translation = self._new_gnu_trans(localedir)


File "/home/robbit/webapps/django_tran_bot/lib/python2.7/Django-1.11.29-py2.7.egg/django/utils/translation/trans_real.py" in _new_gnu_trans

  1. fallback=use_null_fallback)


File "/usr/lib64/python2.7/gettext.py" in translation

  1. t = _translations.setdefault(key, class_(fp))


File "/usr/lib64/python2.7/gettext.py" in init

  1. self._parse(fp)


File "/usr/lib64/python2.7/gettext.py" in _parse

  1. self.plural = c2py(plural)


File "/usr/lib64/python2.7/gettext.py" in c2py

  1. raise ValueError, 'plural forms expression could be dangerous'

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top