Ubuntu系统更新后第三方Python文件触发UnicodeDecodeError求助
Ubuntu系统更新后第三方Python应用UnicodeDecodeError问题求助
Ubuntu机器完成最近一次系统更新后,大量第三方Python文件突然抛出UnicodeDecodeError错误,涉及Gaffer和Arnold渲染器,更新前运行正常,修改源码并非可行方案。报错信息如下:
ERROR : startup/gui/menus.py : Error loading Arnold module - "'utf-8' codec can't decode byte 0xa0 in position 0: invalid start byte". Traceback (most recent call last): File "/home/julius/bin/gaffer-1.3.2.0-linux/startup/gui/menus.py", line 123, in <module> import GafferArnoldUI File "/home/julius/bin/gaffer-1.3.2.0-linux/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 139, in _import return original_import(name, *args, **kwargs) File "/home/julius/bin/gaffer-1.3.2.0-linux/arnold/7.2/python/GafferArnoldUI/__init__.py", line 41, in <module> from . import ArnoldShaderUI File "/home/julius/bin/gaffer-1.3.2.0-linux/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 139, in _import return original_import(name, *args, **kwargs) File "/home/julius/bin/gaffer-1.3.2.0-linux/arnold/7.2/python/GafferArnoldUI/ArnoldShaderUI.py", line 400, in <module> __translateNodeMetadata( arnold.AiNodeEntryIteratorGetNext( nodeIt ) ) File "/home/julius/bin/gaffer-1.3.2.0-linux/arnold/7.2/python/GafferArnoldUI/ArnoldShaderUI.py", line 255, in __translateNodeMetadata presetValues = __enumPresetValues( param ) File "/home/julius/bin/gaffer-1.3.2.0-linux/arnold/7.2/python/GafferArnoldUI/ArnoldShaderUI.py", line 132, in __enumPresetValues preset = arnold.AiEnumGetString( enum, len( presets ) ) File "/opt/Autodesk/arnold/7.2.3.2/python/arnold/ai_enum.py", line 22, in AiEnumGetString return AtPythonStringToStr(_AiEnumGetString(enum_type, index)) File "/opt/Autodesk/arnold/7.2.3.2/python/arnold/ai_types.py", line 36, in AtPythonStringToStr return str(astring) File "/opt/Autodesk/arnold/7.2.3.2/python/arnold/ai_types.py", line 28, in __str__ return self.decode() File "/opt/Autodesk/arnold/7.2.3.2/python/arnold/ai_types.py", line 33, in decode return self.value.decode('utf-8') UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 0: invalid start byte
已尝试的排查操作
- 怀疑系统locale配置异常,重置为默认值并重启,问题依旧。当前locale输出:
> locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=
- 确认系统Python版本指向:
> ll $(which python) lrwxrwxrwx 1 root root 24 Sep 9 15:23 /usr/bin/python -> /etc/alternatives/python
> ll /etc/alternatives/python lrwxrwxrwx 1 root root 19 Sep 9 15:23 /etc/alternatives/python -> /usr/bin/python3.10
目前无法确定后续排查方向,恳请提供解决思路。
内容的提问来源于stack exchange,提问作者julsVFX
相关产品推荐
相关产品推荐

