Licini / compas

compas main library
https://compas-dev.github.io/main/
MIT License
0 stars 0 forks source link

invoke test error with python2.7 on macOS X #9

Closed Licini closed 5 years ago

Licini commented 5 years ago

(compas-dev2) bash-3.2$ invoke test

Traceback (most recent call last): File "//anaconda3/envs/compas-dev2/bin/invoke", line 10, in sys.exit(program.run()) File "//anaconda3/envs/compas-dev2/lib/python2.7/site-packages/invoke/program.py", line 384, in run self.execute() File "//anaconda3/envs/compas-dev2/lib/python2.7/site-packages/invoke/program.py", line 566, in execute executor.execute(self.tasks) File "//anaconda3/envs/compas-dev2/lib/python2.7/site-packages/invoke/executor.py", line 129, in execute result = call.task(args, *call.kwargs) File "//anaconda3/envs/compas-dev2/lib/python2.7/site-packages/invoke/tasks.py", line 127, in call result = self.body(args, kwargs) File "/Users/lichen7/WORK/compas/tasks.py", line 154, in test ctx.run(' '.join(cmd)) File "//anaconda3/envs/compas-dev2/lib/python2.7/site-packages/invoke/context.py", line 94, in run return self._run(runner, command, kwargs) File "//anaconda3/envs/compas-dev2/lib/python2.7/site-packages/invoke/context.py", line 101, in _run return runner.run(command, kwargs) File "//anaconda3/envs/compas-dev2/lib/python2.7/site-packages/invoke/runners.py", line 291, in run return self._run_body(command, kwargs) File "//anaconda3/envs/compas-dev2/lib/python2.7/site-packages/invoke/runners.py", line 318, in _run_body self.encoding = opts["encoding"] or self.default_encoding() File "//anaconda3/envs/compas-dev2/lib/python2.7/site-packages/invoke/runners.py", line 951, in default_encoding return default_encoding() File "//anaconda3/envs/compas-dev2/lib/python2.7/site-packages/invoke/runners.py", line 1405, in default_encoding default = locale.getdefaultlocale()[1] File "//anaconda3/envs/compas-dev2/lib/python2.7/locale.py", line 545, in getdefaultlocale return _parse_localename(localename) File "//anaconda3/envs/compas-dev2/lib/python2.7/locale.py", line 477, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8

Licini commented 5 years ago

Solution: https://coderwall.com/p/-k_93g/mac-os-x-valueerror-unknown-locale-utf-8-in-python

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