I use python 2.6 under linux (SUSE Linux Enterprise Desktop 11 (x86_64)). I tested some very simple code :
import tkColorChooser
tkColorChooser.askcolor()
then if I click on cancel, I always get error like:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.6/lib-tk/tkColorChooser.py", line 62, in askcolor
return Chooser(**options).show()
File "/usr/lib64/python2.6/lib-tk/tkCommonDialog.py", line 50, in show
s = self._fixresult(w, s)
File "/usr/lib64/python2.6/lib-tk/tkColorChooser.py", line 48, in _fixresult
r, g, b = widget.winfo_rgb(result)
File "/usr/lib64/python2.6/lib-tk/Tkinter.py", line 786, in winfo_rgb
self.tk.call('winfo', 'rgb', self._w, color))
_tkinter.TclError: unknown color name ""
I have more complicated code using tkColorChooser, which gives same error if I click on cancel in the color chooser dialog. I think I can catch the error. But is tkColorChooser designed to be like this? Is there any other neater way to cope with this problem? Thanks!