Upgrade to 17.1 from 17.0 problem:UnicodeEncodeError: 'ascii' codec can't encode character '\xc4' in position 50: ordinal not in range(128)
最近 gentoo 从 17.0 更新到 17.1, 需要手动进行升级配置,使用 unsymlink-lib -p --finish 这一步的时候报错,报错如下:
/usr/lib/python-exec/python3.6/unsymlink-lib -p --finish
...
rm -d /usr/lib64/go/test/fixedbugs/issue5957.dir/c.go
rm -d /usr/lib64/go/test/fixedbugs/issue5957.dir/b.go
rm -d /usr/lib64/go/test/fixedbugs/issue5957.dir/a.go
rm -d /usr/lib64/go/test/fixedbugs/bug437.dir/one.go
rm -d /usr/lib64/go/test/fixedbugs/bug437.dir/x.go
rm -d /usr/lib64/go/test/fixedbugs/bug437.dir/two.go
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.6/unsymlink-lib", line 819, in <module>
main()
File "/usr/lib/python-exec/python3.6/unsymlink-lib", line 782, in main
m.finish(pretend=args.pretend, resume=args.action.endswith('resume'))
File "/usr/lib/python-exec/python3.6/unsymlink-lib", line 585, in finish
out('rm -d {}', fp)
File "/usr/lib/python-exec/python3.6/unsymlink-lib", line 41, in out
_log(template, *args, **kwargs)
File "/usr/lib/python-exec/python3.6/unsymlink-lib", line 30, in _log
**kwargs
UnicodeEncodeError: 'ascii' codec can't encode character '\xc4' in position 50: ordinal not in range(128)
我的 unsymlink-lib 的版本是 15,前面的一些 bug 已经修复了,所以检查 locale 的结果,结果发现是 locale 的问题, locale 都是 "POSIX",通过修改 /etc/env.d/02locale,
LANG="en_US.UTF-8"
LC_COLLATE="C"
然后 env-update && source /etc/profile,就解决问题了。