Index: Lib/tkinter/test/test_ttk/test_widgets.py =================================================================== --- Lib/tkinter/test/test_ttk/test_widgets.py (revision 88757) +++ Lib/tkinter/test/test_ttk/test_widgets.py (working copy) @@ -188,6 +188,10 @@ self.combo.configure(values=[1, '', 2]) self.assertEqual(self.combo['values'], ('1', '', '2')) + # testing values with spaces or \ + self.combo['values'] = ['a b', r'a\tb'] + self.assertEqual(self.combo['values'], ('a b', r'a\tb')) + # out of range self.assertRaises(tkinter.TclError, self.combo.current, len(self.combo['values'])) Index: Lib/tkinter/ttk.py =================================================================== --- Lib/tkinter/ttk.py (revision 88757) +++ Lib/tkinter/ttk.py (working copy) @@ -47,6 +47,9 @@ master.tk.eval('package require tile') # TclError may be raised here master._tile_loaded = True +def _need_braces(value): + return ' ' in value or '\\' in value + def _format_optdict(optdict, script=False, ignore=None): """Formats optdict to a tuple to pass it to tk.call. @@ -71,7 +74,7 @@ # format v according to the script option, but also check for # space in any value in v in order to group them correctly value = format % ' '.join( - ('{%s}' if ' ' in val else '%s') % val for val in v) + ('{%s}' if _need_braces(val) else '%s') % val for val in v) if script and value == '': value = '{}' # empty string in Python is equivalent to {} in Tcl