You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a string is passed to plural which contains only a 's it will raise an IndexError Exception:
importinflectp=inflect.engine()
p.plural("'s")
In version 5.6.0:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/_src/sqbu/voicea/wordcloud/.venv/lib/python3.11/site-packages/inflect/__init__.py", line 2376, in plural
self._pl_special_adjective(word, count)
File "/opt/_src/sqbu/voicea/wordcloud/.venv/lib/python3.11/site-packages/inflect/__init__.py", line 3102, in _pl_special_adjective
trailing_s = "" if pl[-1] == "s" else "s"
~~^^^^
IndexError: string index out of range
In version 6.0.4, it changes to a pydantic validation error:
I would expect the method to return an empty string, or otherwise catch this type of error; since technically the input is a two character string (i.e. 's) but the validation strips out some of that to assert.
The text was updated successfully, but these errors were encountered:
When a string is passed to plural which contains only a
's
it will raise an IndexError Exception:In version 5.6.0:
In version 6.0.4, it changes to a pydantic validation error:
https://github.com/jaraco/inflect/blob/main/inflect/__init__.py#L3153-L3157
I would expect the method to return an empty string, or otherwise catch this type of error; since technically the input is a two character string (i.e.
's
) but the validation strips out some of that to assert.The text was updated successfully, but these errors were encountered: