J’ai un script Bottle qui est déclenché lors d’un hook Bitbucket, qui pull+update le repo local et lance un build MkDocs:
from bottle import post, run, redirect
import os
@post('/update/')
def update():
os.system("hg pull -u")
os.system("mkdocs build --clean")
return redirect("/")
run(host='localhost', port=8020)
Après un update du système ou je ne sais quoi, ce script crash au niveau de MkDocs:
added 1 changesets with 1 changes to 1 files
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Traceback (most recent call last):
File "/usr/bin/mkdocs", line 11, in <module>
sys.exit(cli())
File "/opt/python3.4/lib/python3.4/site-packages/click/core.py", line 700, in __call__
return self.main(*args, **kwargs)
File "/opt/python3.4/lib/python3.4/site-packages/click/core.py", line 655, in main
raise RuntimeError('Click will abort further execution '
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Either switch to Python 2 or consult http://click.pocoo.org/python3/ for mitigation steps.
Dans un terminal il n’y a pas de problème avec MkDocs.
Je ne sais pas quoi faire après avoir lu cette page: http://click.pocoo.org/5/python3/
L'affaire se passe sur un Raspberry Pi 2, Raspbian Wheezy.