[LinuxCNC/linuxcnc Issue#146] linuxcnc triggers bug in python 2.7.11-2; work around it

未分类 bolang 4个月前 (10-15) 29次浏览

Issue #146 | 状态: 已关闭 | 作者: jepler | 创建时间: 2016-08-19


Users report that in AXIS, the key sequence F1 F2 y home does not home the Y axis.

This appears to be due to a regression in python-tk, affecting in python 2.7.11-2 (debian stretch) but not 2.7.8-2+b1 (debian wheezy). It also reportedly affects recent Ubuntu and Linux Mint versions.

I have produced a test case and filed a bug in debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834783

I suspect it may actually be caused by a change made in Python 2.7.10: “Issue #21526: Tkinter now supports new boolean type in Tcl 8.5.”

Various workarounds in LinuxCNC have been proposed; I have one that seems to be minimally invasive:

diff --git a/src/emc/usrintf/axis/scripts/axis.py b/src/emc/usrintf/axis/scripts/axis.py
index 5995378..806665f 100755
--- a/src/emc/usr_intf/axis/scripts/axis.py
+++ b/src/emc/usr_intf/axis/scripts/axis.py
@@ -1256,6 +1256,7 @@ widgets = nf.Widgets(root_window,
     ("homemenu", Menu, ".menu.machine.home"),
     ("unhomemenu", Menu, ".menu.machine.unhome")
 )
+widgets.axis_y.configure(value="y")

def activate_axis(i, force=0): if not force and not manual_ok(): return


评论 (1)

#1 – andypugh 于 2019-09-10

This same issue does seem to affect joint-mode jogging with the Axis GUI.

With a print to give the value of the “a” variable:

a is True
Exception in Tkinter callback
Traceback (most recent call last):
File “/usr/lib/python2.7/lib-tk/Tkinter.py”, line 1545, in call
return self.func(*args)
File “/home/andypugh/linuxcnc-dev/bin/axis”, line 2337, in jog_plus
a = “xyzabcuvw”.index(a)
ValueError: substring not found

So “1” is being interpreted as “True”


原始Issue: https://github.com/LinuxCNC/linuxcnc/issues/146

喜欢 (0)