Page MenuHomeSoftware Heritage

Unsupported locale 'en_IN' in arrow lib
Open, NormalPublic

Description

I was trying to run a lister packagist and I encountered this error.

(swh) utkarsh@G3:~/swh-environment$ swh scheduler --url http://localhost:5008/ task add \
> list-packagist-full --policy oneshot 
/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/swh/scheduler/__init__.py:69: DeprecationWarning: Call to deprecated class SWHRemoteAPI. (Use the RPCClient instead) -- Deprecated since version 0.0.64.
  return SchedulerBackend(**args)
Traceback (most recent call last):
  File "/home/utkarsh/.virtualenvs/swh/bin/swh", line 11, in <module>
    load_entry_point('swh.core', 'console_scripts', 'swh')()
  File "/home/utkarsh/swh-environment/swh-core/swh/core/cli/__init__.py", line 56, in main
    return swh(auto_envvar_prefix='SWH')
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/swh/scheduler/cli/task.py", line 271, in schedule_task
    output.append(pretty_print_task(task))
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/swh/scheduler/cli/task.py", line 119, in pretty_print_task
    "%s (%s)" % (next_run.humanize(locale=ARROW_LOCALE),
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/arrow/arrow.py", line 851, in humanize
    locale = locales.get_locale(locale)
  File "/home/utkarsh/.virtualenvs/swh/lib/python3.7/site-packages/arrow/locales.py", line 20, in get_locale
    raise ValueError("Unsupported locale '{}'".format(name))
ValueError: Unsupported locale 'en_IN'

Event Timeline

GoodwillHunter triaged this task as Normal priority.Aug 8 2019, 10:10 PM
GoodwillHunter created this task.
GoodwillHunter created this object in space S1 Public.

I solved this issue by changing my system locale to 'en_US'.
You can refer to these tutorials to change your system
https://www.tecmint.com/set-system-locales-in-linux/
https://askubuntu.com/questions/89976/how-do-i-change-the-default-locale-in-ubuntu-server

Btw @ardumont, shall we add this somewhere in our documentation. Although I feel this is more of arrow library issue rather than swh issue.

Thanks @nahimilega, changing locale worked out fine

Although I feel this is more of arrow library issue rather than swh issue.

Yes indeed

vlorentz edited projects, added Core & foundations; removed Lister.Aug 12 2019, 4:20 PM
vlorentz edited projects, added Scheduling utilities; removed Core & foundations.