Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95731

Re: Linux users: please run gui tests

From Christian Gollwitzer <auriocus@gmx.de>
Newsgroups comp.lang.python
Subject Re: Linux users: please run gui tests
Date 2015-08-28 10:52 +0200
Organization A noiseless patient Spider
Message-ID <mrp7cd$qp6$1@dont-email.me> (permalink)
References <mq13t3$k2k$1@ger.gmane.org> <CA+=+wqCkJ+r5SO7NcZFi90OiNs6UC7n_Rq2RyPErpf8BaxFb4w@mail.gmail.com> <mailman.85.1440700403.11709.python-list@python.org> <mrot3v$ref$1@dont-email.me> <mailman.99.1440744408.11709.python-list@python.org>

Show all headers | View raw


Am 28.08.15 um 08:46 schrieb Terry Reedy:
> On 8/28/2015 1:56 AM, Christian Gollwitzer wrote:
>> Am 27.08.15 um 20:32 schrieb Terry Reedy:
>>> On 8/27/2015 4:56 AM, Petr Viktorin wrote:
>>>> 1321, in _configure
>>>>      self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
>>>> _tkinter.TclError: expected integer but got ""
>>>>
>>>
>>> Very puzzling. The only obviously even possibly relevant change from 3.4
>>> to 3.6 is that the Tk version for 3.4.3 is 8.6.1. configDialog is
>>> identical in 3.4 and 3.6.
>>
>> tkinter is a bit stupid, as it does not report the command that was
>> passed to Tcl. It would be helpful if you printed it out before the
>> call, i.e.
>>
>> print(_flatten((self._w, cmd)) + self._options(cnf))
>>
>> Can you inject this into both versions of the code?
>>
>> There is something about fonts. It could also have something to do with
>> Xft, a compile-time option of Tk, to use fontconfig (vague guess).
>
> I decided to open a tracker issue so this does not get lost.
> https://bugs.python.org/issue24951
>

Here is a small patch which improves the error message a lot:
diff -ru Python-3.4.3/Modules/_tkinter.c 
Python-3.4.3-patched/Modules/_tkinter.c
--- Python-3.4.3/Modules/_tkinter.c	2015-02-25 12:27:45.000000000 +0100
+++ Python-3.4.3-patched/Modules/_tkinter.c	2015-08-28 
10:27:15.000000000 +0200
@@ -276,7 +276,8 @@
  static PyObject *
  Tkinter_Error(PyObject *v)
  {
-    PyErr_SetString(Tkinter_TclError, Tkapp_Result(v));
+    const char *errorInfo = Tcl_GetVar(Tkapp_Interp(v), "errorInfo", 
TCL_GLOBAL_ONLY);
+    PyErr_SetString(Tkinter_TclError, errorInfo);
      return NULL;
  }


Instead of just the error, this prints the full Tcl stack trace.

Compare:
=========== before ============
Apfelkiste:Python-3.4.3 chris$ ./python.exe
Python 3.4.3 (default, Aug 28 2015, 10:33:48)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import tkinter; root=tkinter.Tk()
 >>> root.eval("grid rowconfigure . 0 -weight {}")
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
_tkinter.TclError: expected integer but got ""
=============================

with

=========== after =============
Apfelkiste:Python-3.4.3-patched chris$ ./python.exe
Python 3.4.3 (default, Aug 28 2015, 10:29:50)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import tkinter; root=tkinter.Tk()
 >>> root.eval("grid rowconfigure . 0 -weight {}")
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
_tkinter.TclError: expected integer but got ""
     while executing
"grid rowconfigure . 0 -weight {}"
 >>>
==================================

Is there a chance to get this fixed upstream in Tkinter?

	Christian

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Linux users: please run gui tests Terry Reedy <tjreedy@udel.edu> - 2015-08-27 14:32 -0400
  Re: Linux users: please run gui tests Christian Gollwitzer <auriocus@gmx.de> - 2015-08-28 07:56 +0200
    Re: Linux users: please run gui tests Terry Reedy <tjreedy@udel.edu> - 2015-08-28 02:46 -0400
      Re: Linux users: please run gui tests Christian Gollwitzer <auriocus@gmx.de> - 2015-08-28 10:52 +0200
        Re: Linux users: please run gui tests Terry Reedy <tjreedy@udel.edu> - 2015-08-29 00:48 -0400

csiph-web