clicking "cancel" in tkColorChooser dialog leads to Error
Question: 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!


Answer: Looking at the version of tkColorChooser.py I have (Python 2.6.4, Win32), it
should support the user pressing `cancel` (as do and should the other
predefined dialogs): it is indeed supposed to return None when the results
evals to `False` in a boolean context.

Therefore, something strange is happening.

edit: as I noted in the comments, it is indeed a bug that has been fixed in
version 2.6.2.

