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


Groups > comp.lang.python > #95705 > unrolled thread

Re: Linux users: please run gui tests

Started byTerry Reedy <tjreedy@udel.edu>
First post2015-08-27 14:32 -0400
Last post2015-08-29 00:48 -0400
Articles 5 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  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

#95705 — Re: Linux users: please run gui tests

FromTerry Reedy <tjreedy@udel.edu>
Date2015-08-27 14:32 -0400
SubjectRe: Linux users: please run gui tests
Message-ID<mailman.85.1440700403.11709.python-list@python.org>
On 8/27/2015 4:56 AM, Petr Viktorin wrote:
> On Fri, Aug 7, 2015 at 4:07 AM, Terry Reedy <tjreedy@udel.edu> wrote:
>> Python has an extensive test suite run after each 'batch' of commits on a
>> variety of buildbots.  However, the Linux buildbots all (AFAIK) run
>> 'headless', with gui's disabled.  Hence the following
>> test_tk test_ttk_guionly test_idle
>> (and on 3.5, test_tix, but not important)
>> are skipped either in whole or in part.
>>
>> We are planning on adding the use of tkinter.ttk to Idle after the 3.5.0
>> release, but a couple of other core developers have expressed concern about
>> the reliability of tkinter.ttk on Linux.
>>
>> There is also an unresolved issue where test_ttk hung on Ubuntu Unity 3
>> years ago. https://bugs.python.org/issue14799
>>
>> I would appreciate it if some people could run the linux version of
>> py -3.4 -m test -ugui test_tk test_ttk_guionly test_idle
>> (or 3.5).  I guess this means 'python3 for the executable.
>>
>> and report here python version, linux system, and result.
>> Alteration of environment and locale is a known issue, skip that.
>
> On Fedora 21, the tests pass (Python 3.4.1 and latest dev version).
>
> On Fedora 23, I see:
>
> $ python3 -V
> Python 3.4.3
> $ python3 -m test -ugui test_tk test_ttk_guionly test_idle
> [1/3] test_tk
> [2/3] test_ttk_guionly
> [3/3] test_idle
> All 3 tests OK.
>
> $ ./python -V
> Python 3.6.0a0
> $ ./python -m test -ugui test_tk test_ttk_guionly test_idle
> [1/3] test_tk
> [2/3] test_ttk_guionly
> [3/3] test_idle
> test test_idle failed -- Traceback (most recent call last):
>    File "/home/pviktori/dev/cpython/Lib/idlelib/idle_test/test_configdialog.py",
> line 27, in test_dialog
>      d=ConfigDialog(self.root, 'Test', _utest=True)
>    File "/home/pviktori/dev/cpython/Lib/idlelib/configDialog.py", line
> 71, in __init__
>      self.LoadConfigs()
>    File "/home/pviktori/dev/cpython/Lib/idlelib/configDialog.py", line
> 1078, in LoadConfigs
>      self.LoadFontCfg()
>    File "/home/pviktori/dev/cpython/Lib/idlelib/configDialog.py", line
> 980, in LoadFontCfg
>      self.SetFontSample()
>    File "/home/pviktori/dev/cpython/Lib/idlelib/configDialog.py", line
> 858, in SetFontSample
>      self.labelFontSample.config(font=newFont)
>    File "/home/pviktori/dev/cpython/Lib/tkinter/__init__.py", line
> 1330, in configure
>      return self._configure('configure', cnf, kw)
>    File "/home/pviktori/dev/cpython/Lib/tkinter/__init__.py", line
> 1321, in _configure
>      self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
> _tkinter.TclError: expected integer but got ""
>
> 2 tests OK.
> 1 test failed:
>      test_idle
>
> Tk version: 8.6.4

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.  Is this a transient failure or does it repeat 
when you repeat the test?  Is Fedora 23 'stable' or 'in development'?

-- 
Terry Jan Reedy

[toc] | [next] | [standalone]


#95722

FromChristian Gollwitzer <auriocus@gmx.de>
Date2015-08-28 07:56 +0200
Message-ID<mrot3v$ref$1@dont-email.me>
In reply to#95705
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).

	Christian

[toc] | [prev] | [next] | [standalone]


#95727

FromTerry Reedy <tjreedy@udel.edu>
Date2015-08-28 02:46 -0400
Message-ID<mailman.99.1440744408.11709.python-list@python.org>
In reply to#95722
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

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#95731

FromChristian Gollwitzer <auriocus@gmx.de>
Date2015-08-28 10:52 +0200
Message-ID<mrp7cd$qp6$1@dont-email.me>
In reply to#95727
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

[toc] | [prev] | [next] | [standalone]


#95752

FromTerry Reedy <tjreedy@udel.edu>
Date2015-08-29 00:48 -0400
Message-ID<mailman.120.1440823765.11709.python-list@python.org>
In reply to#95731
On 8/28/2015 4:52 AM, Christian Gollwitzer wrote:

> 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?

There might be if someone opened a new tkinter tracker issue for this. 
Can you do so?

-- 
Terry Jan Reedy

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web