[New-bugs-announce] [issue23880] Tkinter: getint and getdouble should support Tcl_Obj
report at bugs.python.org
Tue Apr 7 10:41:04 CEST 2015
New submission from Serhiy Storchaka:
getint, getdouble and getboolean were thin wrappers around Tcl functions that converted string result of Tcl call to specified Python type. Since 2.3 _tkinter can return not only string, but int, float, etc and Tcl_Obj (if wantobject is True). getXXX methods was updated to work with respective automatically converted types (getint with int, etc), but they don't work with general Tcl_Obj, so can't be applied to the result of _tkinter call in general case. As a workaround you should use int(str(value)) or like.
Support of Tcl_Obj in getbool was added in issue15133. Proposed patch adds support of Tcl_Obj in getint and getdouble and int in getdouble. It also restores the use of getint and getdouble in Tkinter.
components: Extension Modules, Tkinter
stage: patch review
title: Tkinter: getint and getdouble should support Tcl_Obj
versions: Python 3.5
Added file: http://bugs.python.org/file38855/tkinter_getxxx_tclobj.patch
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce