houtianze/bypy

Exception: You MUST set system locale to 'UTF-8' to support unicode file names.

Closed this issue · 3 comments

python2.6,Centos英文环境。
Locale都设成en_US.UTF-8
Python的getdefaultencoding()和getfilesystemencoding()都已设置成UTF-8
为什么还是报错?
尝试安装了中文语言包,Locale改成zh_CN.UTF-8
依然报错
问题可能比较低级,但一直无解。请指教

好吧,升了2.7,依然报错。直接注释掉,正常使用。

贴下你locale的输出?如果你设定了UTF-8,按理不应该有问题啊。
注释掉可以,问题不大。这个警告是为了确保能搞上传中文名字文件才强制加上去的,如果你上传中文名文件不出问题,就可以忽略这个。

SystemEncoding.upper() 打印出什么?

@cheaphunter 能帮忙贴下shell下,下面这个命令的输出吗?
python -c "import locale; print locale.getdefaultlocale()"