diff -r 9928a927975f Lib/tkinter/__init__.py --- a/Lib/tkinter/__init__.py Sat Nov 02 13:21:28 2013 -0500 +++ b/Lib/tkinter/__init__.py Sat Nov 02 21:48:24 2013 +0200 @@ -3472,7 +3472,7 @@ bounding box may refer to a region outside the visible area of the window. """ - return self.tk.call(self._w, 'bbox', index) + return self._getints(self.tk.call(self._w, 'bbox', index)) def delete(self, first, last=None): """Delete one or more elements of the spinbox. @@ -3481,9 +3481,9 @@ and last is the index of the character just after the last one to delete. If last isn't specified it defaults to first+1, i.e. a single character is - deleted. This command returns an empty string. + deleted. """ - return self.tk.call(self._w, 'delete', first, last) + self.tk.call(self._w, 'delete', first, last) def get(self): """Returns the spinbox's string""" @@ -3493,9 +3493,9 @@ """Alter the position of the insertion cursor. The insertion cursor will be displayed just before - the character given by index. Returns an empty string + the character given by index. """ - return self.tk.call(self._w, 'icursor', index) + self.tk.call(self._w, 'icursor', index) def identify(self, x, y): """Returns the name of the widget at position x, y @@ -3505,16 +3505,12 @@ return self.tk.call(self._w, 'identify', x, y) def index(self, index): - """Returns the numerical index corresponding to index - """ + """Returns the numerical index corresponding to index.""" return self.tk.call(self._w, 'index', index) def insert(self, index, s): - """Insert string s at index - - Returns an empty string. - """ - return self.tk.call(self._w, 'insert', index, s) + """Insert string s at index.""" + self.tk.call(self._w, 'insert', index, s) def invoke(self, element): """Causes the specified element to be invoked @@ -3522,7 +3518,7 @@ The element could be buttondown or buttonup triggering the action associated with it. """ - return self.tk.call(self._w, 'invoke', element) + self.tk.call(self._w, 'invoke', element) def scan(self, *args): """Internal function.""" diff -r 9928a927975f Lib/tkinter/test/test_tkinter/test_widgets.py --- a/Lib/tkinter/test/test_tkinter/test_widgets.py Sat Nov 02 13:21:28 2013 -0500 +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py Sat Nov 02 21:48:24 2013 +0200 @@ -457,6 +457,18 @@ widget = self.create() self.checkBooleanParam(widget, 'wrap') + def test_bbox(self): + widget = self.create() + bbox = widget.bbox(0) + self.assertEqual(len(bbox), 4) + for item in bbox: + self.assertIsInstance(item, int) + + self.assertRaises(tkinter.TclError, widget.bbox, 'noindex') + self.assertRaises(tkinter.TclError, widget.bbox, None) + self.assertRaises(TypeError, widget.bbox) + self.assertRaises(TypeError, widget.bbox, 0, 1) + @add_standard_options(StandardOptionsTests) class TextTest(AbstractWidgetTest, unittest.TestCase): diff -r 9928a927975f Misc/NEWS --- a/Misc/NEWS Sat Nov 02 13:21:28 2013 -0500 +++ b/Misc/NEWS Sat Nov 02 21:48:24 2013 +0200 @@ -31,6 +31,10 @@ Library ------- +- Issue #6160: The bbox() method of tkinter.Spinbox now returns a tuple of + integers instead of a string. The delete(), icursor(), insert(), and invoke() + methods now returns None instead of an empty string. + - Issue #19286: Directories in ``package_data`` are no longer added to the filelist, preventing failure outlined in the ticket.