Running python scripts from cron (e.g. gitinspector)
You may encounter several errors while running python scripts that work with terminal and translations:
- Error getting LANG from environ:
File "/usr/lib/python2.7/dist-packages/gitinspector/localization.py", line 48, in init os.environ['LANG'] = lang[0] File "/usr/lib/python2.7/os.py", line 471, in __setitem__ putenv(key, item) TypeError: must be string, not None
- Error getting sys.stdin.encoding
argv.append(arg.decode(sys.stdin.encoding, "replace")) TypeError: decode() argument 1 must be string, not None
export LOCALE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export PYTHONIOENCODING='utf-8'
/usr/bin/gitinspector -f py,js,sql,html,css,txt,sh --grading --format=html path_to_repo