我正在运行 OS X 10.9.5、Python 2.7.9 的旧款 MacBook 上尝试 bCNC。更新 pip/setuptools 后安装正常,但在尝试启动时出现错误:
new-config Utils <ConfigParser.ConfigParser instance at 0x109aadf80>
self.canvas.winfo_id(): -2067257328
Using old style comports()!
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/site-packages/bCNC/__main__.py", line 2708, in <module>
main()
File "/usr/local/lib/python2.7/site-packages/bCNC/__main__.py", line 2676, in main
application = Application(tk)
File "/usr/local/lib/python2.7/site-packages/bCNC/__main__.py", line 196, in __init__
page = cls(self.ribbon, self)
File "/usr/local/lib/python2.7/site-packages/bCNC/CNCRibbon.py", line 115, in __init__
self.register()
File "/usr/local/lib/python2.7/site-packages/bCNC/FilePage.py", line 395, in register
(SerialFrame,))
File "/usr/local/lib/python2.7/site-packages/bCNC/CNCRibbon.py", line 134, in _register
w = f(self.master._pageFrame, self.app)
File "/usr/local/lib/python2.7/site-packages/bCNC/FilePage.py", line 253, in __init__
self.comportRefresh()
File "/usr/local/lib/python2.7/site-packages/bCNC/FilePage.py", line 351, in comportRefresh
hwgrep += ["hwgrep://"+hw+"\t"+i[1]]
TypeError: cannot concatenate 'str' and 'NoneType' objects
def comportsGet(self):
try:
return comports(include_links=True)
except TypeError:
print("Using old style comports()!")
tmp = comports()
for i in tmp:
if i[1] is None: i[1] = '-'
return tmp
我正在运行 OS X 10.9.5、Python 2.7.9 的旧款 MacBook 上尝试 bCNC。更新 pip/setuptools 后安装正常,但在尝试启动时出现错误:
我追踪到它有一些
None显然不期望comports()返回的值:因此,为了解决方法,我在 FilePage.py 中添加了以下内容: