This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients Bryan.Oakley, serhiy.storchaka, terry.reedy
Date 2018-04-21.03:24:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524281092.48.0.682650639539.issue33289@psf.upfronthosting.co.za>
In-reply-to
Content
For future reference, 3.4 and 3.5 only get security fixes.

The quoted line of code is from the main part of tkinter.colorchooser,Chooser._fixresult:
        r, g, b = widget.winfo_rgb(result)
        return (r/256, g/256, b/256), str(result)

where tkinter.Misc defines
    def winfo_rgb(self, color):
        """Return tuple of decimal values for red, green, blue for
        COLOR in this widget."""
        return self._getints(
            self.tk.call('winfo', 'rgb', self._w, color))

The code in tkColorChooser and Tkinter in 2.x is the same.

The docstring for winfo_rgb is wrong as it returns a tuple of ints in range(2**16256).  For red, the results are
>>> Tk().winfo_rgb('red')
(65535, 0, 0)  # 2.x and 3.x
>>> cc.askcolor('red')
((255, 0, 0), '#ff0000')  # 2.7
>>> cc.askcolor('red')
((255.99609375, 0.0, 0.0), '#ff0000')  # 3.8

In addition to fixing the winfo_rgb docstring (in all versions), and adding doc strings to colorchooser, it seems that '/' should be '//' in 3.x.  I don't know if I would fix this in 3.6.
History
Date User Action Args
2018-04-21 03:24:52terry.reedysetrecipients: + terry.reedy, serhiy.storchaka, Bryan.Oakley
2018-04-21 03:24:52terry.reedysetmessageid: <1524281092.48.0.682650639539.issue33289@psf.upfronthosting.co.za>
2018-04-21 03:24:52terry.reedylinkissue33289 messages
2018-04-21 03:24:50terry.reedycreate