Opened 5 years ago

Closed 5 years ago

#3200 closed defect (fixed)

configfile/configparser not handling encoding

Reported by: zhaowenxu@… Owned by: Greg Couch
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc: Eric Pettersen
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Windows-7-6.1.7601-SP1
ChimeraX Version: 1.0 (2020-05-09)
Description
chimerax.core.toolshed.ToolshedError: start_tool() failed for tool Modeller Comparative in bundle ChimeraX-Modeller:
'gbk' codec can't decode byte 0xa0 in position 109: illegal multibyte sequence

File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-packages\chimerax\core\toolshed\info.py", line 627, in start_tool
"start_tool() failed for tool %s in bundle %s:\n%s" % (tool_name, self.name, str(e)))

See log for complete Python traceback.

Log:
UCSF ChimeraX version: 1.0rc202005091901 (2020-05-09)  
© 2016-2020 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> toolshed show "Modeller Comparative"

Traceback (most recent call last):  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\core\toolshed\info.py", line 621, in start_tool  
ti = api._api_caller.start_tool(api, session, self, tool_info)  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\core\toolshed\\__init__.py", line 1640, in start_tool  
return cls._get_func(api, "start_tool")(session, ti.name)  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\modeller\\__init__.py", line 37, in start_tool  
return ModellerLauncher(session, tool_name)  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\modeller\tool.py", line 66, in __init__  
settings = get_settings(session)  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\modeller\settings.py", line 33, in get_settings  
settings = _ModellerSettings(session, "modeller")  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\core\settings.py", line 165, in __init__  
ConfigFile.__init__(self, session, tool_name, version=version)  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\core\configfile.py", line 289, in __init__  
self._config.read(self._filename)  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\configparser.py",
line 696, in read  
self._read(fp, filename)  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\configparser.py",
line 1014, in _read  
for lineno, line in enumerate(fp, start=1):  
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa0 in position 109:
illegal multibyte sequence  
  
During handling of the above exception, another exception occurred:  
  
Traceback (most recent call last):  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\ui\gui.py", line 1467, in <lambda>  
run(ses, "toolshed show %s" % StringArg.unparse(tool_name)))  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\core\commands\run.py", line 31, in run  
results = command.run(text, log=log)  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\core\commands\cli.py", line 2849, in run  
result = ci.function(session, **kw_args)  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\core\commands\toolshed.py", line 365, in toolshed_show  
bi.start_tool(session, name)  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\core\toolshed\info.py", line 627, in start_tool  
"start_tool() failed for tool %s in bundle %s:\n%s" % (tool_name, self.name,
str(e)))  
chimerax.core.toolshed.ToolshedError: start_tool() failed for tool Modeller
Comparative in bundle ChimeraX-Modeller:  
'gbk' codec can't decode byte 0xa0 in position 109: illegal multibyte sequence  
  
chimerax.core.toolshed.ToolshedError: start_tool() failed for tool Modeller
Comparative in bundle ChimeraX-Modeller:  
'gbk' codec can't decode byte 0xa0 in position 109: illegal multibyte sequence  
  
File "D:\Specific Program\ChimeraX 1.0rc202005091901\bin\lib\site-
packages\chimerax\core\toolshed\info.py", line 627, in start_tool  
"start_tool() failed for tool %s in bundle %s:\n%s" % (tool_name, self.name,
str(e)))  
  
See log for complete Python traceback.  
  




OpenGL version: 3.3.13464 Core Profile Forward-Compatible Context FireGL 21.19.384.0
OpenGL renderer: AMD FirePro W4100
OpenGL vendor: ATI Technologies Inc.
Manufacturer: Dell Inc.
Model: Precision Tower 3620
OS: Microsoft Windows 7 专业版  (Build 7601)
Memory: 17,102,462,976
MaxProcessMemory: 8,589,934,464
CPU: 4 Intel(R) Xeon(R) CPU E3-1225 v5 @ 3.30GHz"

Change History (3)

comment:1 by Eric Pettersen, 5 years ago

Cc: Eric Pettersen added
Component: UnassignedCore
Owner: set to Greg Couch
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionconfigfile/configparser not handling encoding

Apparently triggered in this case by a path name with exotic characters in settings.

comment:2 by Greg Couch, 5 years ago

Status: assignedfeedback

I believe I fixed this. The bug was that the utf-8 encoding was not specified when reading the preferences file.

Please download and test the next release candidate, with a build date of 2020-05-14 or newer, and confirm if the bug is fixed or not.

Thank you. -- Greg

comment:3 by Greg Couch, 5 years ago

Resolution: fixed
Status: feedbackclosed

No response. Assume it's been fixed.

Note: See TracTickets for help on using tickets.