chaostoolkit / chaostoolkit-reporting

Reporting plugin for chaostoolkit journal results
Apache License 2.0
10 stars 11 forks source link

Reporting crashes when trying to get the locale #20

Open joaoasrosa opened 5 years ago

joaoasrosa commented 5 years ago

After I install all the dependencies, and use a virtual environment, when trying to generate a report (chaos report) I have the following problem:

Warning: entry point could not be loaded. Contact its author for help.

Traceback (most recent call last):
  File "/Users/joaorosa/.venvs/chaostk/lib/python3.7/site-packages/click_plugins/core.py", line 37, in decorator
    group.add_command(entry_point.load())
  File "/Users/joaorosa/.venvs/chaostk/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/Users/joaorosa/.venvs/chaostk/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Users/joaorosa/.venvs/chaostk/lib/python3.7/site-packages/chaosreport/__init__.py", line 16, in <module>
    import cairosvg
  File "/Users/joaorosa/.venvs/chaostk/lib/python3.7/site-packages/cairosvg/__init__.py", line 42, in <module>
    from . import surface  # noqa isort:skip
  File "/Users/joaorosa/.venvs/chaostk/lib/python3.7/site-packages/cairosvg/surface.py", line 28, in <module>
    from .defs import (
  File "/Users/joaorosa/.venvs/chaostk/lib/python3.7/site-packages/cairosvg/defs.py", line 24, in <module>
    from .bounding_box import calculate_bounding_box, is_non_empty_bounding_box
  File "/Users/joaorosa/.venvs/chaostk/lib/python3.7/site-packages/cairosvg/bounding_box.py", line 26, in <module>
    from .features import match_features
  File "/Users/joaorosa/.venvs/chaostk/lib/python3.7/site-packages/cairosvg/features.py", line 25, in <module>
    LOCALE = locale.getdefaultlocale()[0] or ''
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/locale.py", line 568, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/locale.py", line 495, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8

What extra configuration is needed for the locale?

Lawouach commented 5 years ago

Hey,

I can only assume that the UTF-8 locale isn't installed by default on your machine. I don't think our code makes an explicit requirement for it but one of the dependency seems to.

Seems to be an old bug in Python that has been fixed recently:

https://bugs.python.org/issue18378

I don't own a Mac so I don't know how it could be deployed.

joaoasrosa commented 5 years ago

Hey, Thanks. And you triggered me. The solution that I used was: https://coderwall.com/p/-k_93g/mac-os-x-valueerror-unknown-locale-utf-8-in-python .

Given that I'm not a python expert, the guidance was helpful.

I will do a PR for the documentation.

Lawouach commented 5 years ago

awesome, thanks