python-fluent icon indicating copy to clipboard operation
python-fluent copied to clipboard

Cannot read string beyond 1000 characters

Open GetPsyched opened this issue 4 years ago • 1 comments

When trying to access a string with the format_value() method, it returns the string normally given it's a relatively short string. But if a string longer than 73 lines is entered, it returns {???} instead of said string. PFA test case which will help reproduce the bug here.

GetPsyched avatar Aug 10 '21 08:08 GetPsyched

Python resolver has a hard limit on number of characters in a pattern part:

  • https://github.com/projectfluent/python-fluent/blob/c58681f1e90c14dd36c2ff35d7d487235b685177/fluent.runtime/fluent/runtime/resolver.py#L116
  • https://github.com/projectfluent/python-fluent/blob/c58681f1e90c14dd36c2ff35d7d487235b685177/fluent.runtime/fluent/runtime/resolver.py#L145-L148

That limit results in any pattern part that is longer than 1000 characters to be rejected.

This behavior is unique to Python implementation of Fluent and has no equivalent in Rust or JS versions.

zbraniecki avatar Aug 10 '21 09:08 zbraniecki