l3uddz / traktarr

Script to add new series & movies to Sonarr/Radarr based on Trakt lists.
GNU General Public License v3.0
576 stars 52 forks source link

Suggested Documentation Addition - systemd Environment locales #83

Closed LettuceSnob closed 4 years ago

LettuceSnob commented 5 years ago

Describe the bug It took me several days to create a valid systemd file that Python3 was happy with. I'd recommend updating the documentation and adding these two lines to the [Service] block of the service file, in case any other Ubuntu 16.04 users encounter the same complaints from Python3 about locales not being exported.

Environment=LC_ALL=C.UTF-8
Environment=LANG=C.UTF-8

To Reproduce Steps to reproduce the behavior:

  1. enable the currently provided systemd service file on Ubuntu 16.04
  2. systemctl start traktarr.service
  3. Service doesn't start, citing exit code=1
  4. journalctl -xe provides the following:
Traceback (most recent call last):
  File "/usr/local/bin/traktarr", line 951, in <module>
    app()
  File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 676, in main
    _verify_python3_env()
  File "/usr/local/lib/python3.5/dist-packages/click/_unicodefun.py", line 118, in _verify_python3_env
    'for mitigation steps.' + extra)
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult http://click.pocoo.org/python3/for mitigation steps.

This system supports the C.UTF-8 locale which is recommended.
You might be able to resolve your issue by exporting the
following environment variables:

    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8

System Information

Additional context running each export [locale] command also works, but it's not permanent. The locales aren't retained after reboot.