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
Activation succeed, for later humanization in a specific language to work.
What actually happened?
>>> humanize.i18n.activate("es_ES")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/facundo/temp/testhum/lib/python3.8/site-packages/humanize/i18n.py", line 58, in activate
translation = gettext_module.translation("humanize", path, [locale])
File "/usr/lib/python3.8/gettext.py", line 603, in translation
raise FileNotFoundError(ENOENT,
FileNotFoundError: [Errno 2] No translation file found for domain: 'humanize'
What versions are you using?
OS: Ubuntu 20.10
Python: 3.8.6
Humanize: 3.7.0
Please include code that reproduces the issue:
$ virtualenv testhumcreated virtual environment CPython3.8.6.final.0-64 in 193ms creator CPython3Posix(dest=/home/facundo/temp/testhum, clear=False, global=False) seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/facundo/.local/share/virtualenv) added seed packages: pip==20.1.1, pkg_resources==0.0.0, setuptools==44.0.0, wheel==0.34.2 activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
$ source testhum/bin/activate(testhum) $ pip install humanizeCollecting humanize Using cached humanize-3.7.0-py3-none-any.whl (48 kB)Requirement already satisfied: setuptools in ./testhum/lib/python3.8/site-packages (from humanize) (44.0.0)Installing collected packages: humanizeSuccessfully installed humanize-3.7.0(testhum) $ pythonPython 3.8.6 (default, May 27 2021, 13:28:02) [GCC 10.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import humanize>>> humanize.__file__'/home/facundo/temp/testhum/lib/python3.8/site-packages/humanize/__init__.py'>>> humanize.i18n.activate("es_ES")Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/facundo/temp/testhum/lib/python3.8/site-packages/humanize/i18n.py", line 58, in activate translation = gettext_module.translation("humanize", path, [locale]) File "/usr/lib/python3.8/gettext.py", line 603, in translation raise FileNotFoundError(ENOENT,FileNotFoundError: [Errno 2] No translation file found for domain: 'humanize'
The exception happens in gettext because it's not finding the .mo files, this is the beginning of the gettext function that is called by humanize:
Okay, so I had missed a step from release checklist. I've updated the checklist to make this less likely next time, and released 3.7.1.
The longer term solution will be to automate deploys, which will make it easier and quicker to deploy as well. I'll need to ask for admin permissions for this repo to do that.
What did you do?
Activated the translations.
What did you expect to happen?
Activation succeed, for later humanization in a specific language to work.
What actually happened?
>>> humanize.i18n.activate("es_ES") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/facundo/temp/testhum/lib/python3.8/site-packages/humanize/i18n.py", line 58, in activate translation = gettext_module.translation("humanize", path, [locale]) File "/usr/lib/python3.8/gettext.py", line 603, in translation raise FileNotFoundError(ENOENT, FileNotFoundError: [Errno 2] No translation file found for domain: 'humanize'
What versions are you using?
Please include code that reproduces the issue:
The exception happens in
gettext
because it's not finding the.mo
files, this is the beginning of the gettext function that is called byhumanize
:That code searches for the
.mo
files, and as it doesn't find them, it raises the exception.And the
.mo
files are not found because they are not there:The text was updated successfully, but these errors were encountered: