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:
- Reverting to the early-July version of the .po files;
- Removing the ‘Plural Forms’ line from the .po files;
- 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
- 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
- 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
- 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
- response = wrapped_callback(request, *callback_args, callback_kwargs)
File "/home/robbit/webapps/django_tran_bot/tran_bot/core/decorators.py" in _view
- 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
- 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
- return handler(request, *args, kwargs)
File "/home/robbit/webapps/django_tran_bot/tran_bot/translation/views.py" in get
- for_extension=request.is_ajax())
File "/home/robbit/webapps/django_tran_bot/tran_bot/translation/manager.py" in find_translations
- 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
- 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
- return strip_tags(unicode(self))
File "/home/robbit/webapps/django_tran_bot/tran_bot/word/mixins.py" in str
- return parse_markdown(main_field_value, self.lang())
File "/home/robbit/webapps/django_tran_bot/tran_bot/core/utils/html.py" in parse_markdown
- 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
- 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
- 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
- _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
- _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
- 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
- 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
- fallback=use_null_fallback)
File "/usr/lib64/python2.7/gettext.py" in translation
- t = _translations.setdefault(key, class_(fp))
File "/usr/lib64/python2.7/gettext.py" in init
- self._parse(fp)
File "/usr/lib64/python2.7/gettext.py" in _parse
- self.plural = c2py(plural)
File "/usr/lib64/python2.7/gettext.py" in c2py
- raise ValueError, 'plural forms expression could be dangerous'