Page MenuHomeSolus

python3-tkinter: tkinter._test() fails
Closed, ResolvedPublic

Description

$ date -I
2017-06-04
$ lsb_release -a
LSB Version:	1.4
Distributor ID:	Solus
Description:	Solus
Release:	2017.04.18.0
Codename:	shannon
$ sudo eopkg upgrade
Updating repositories
Updating repository: Solus
eopkg-index.xml.xz.sha1sum     (40.0  B)100%    139.56 KB/s [00:00:00] [complete]
Solus repository information is up-to-date.
No packages to upgrade.
$ sudo eopkg install python3-tkinter
The following package(s) are already installed and are not going to be installed again:
python3-tkinter
No packages to install.
$ sudo eopkg info python3-tkinter | grep Name
Name                : python3-tkinter, version: 3.5.2, release: 12
Name                : python3-tkinter, version: 3.5.2, release: 12
$ python3
Python 3.5.2 (default, Nov 12 2016, 19:04:03) 
[GCC 6.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> tkinter._test()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/tkinter/__init__.py", line 3837, in _test
    root = Tk()
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1868, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: unknown color name "BACKGROUND"

Following instructions of https://wiki.python.org/moin/TkInter#line-85

Event Timeline

try this : sudo eopkg it --reinstall python3-tkinter tk tcl

$  sudo eopkg it --reinstall python3-tkinter tk tcl     
Password: 
Following packages will be installed:
python3-tkinter  tcl  tk
Total size of package(s): 2.21 MB
Downloading 1 / 3
Package tcl found in repository Solus
tcl-8.6.6-5-1-x86_64.eopkg [cached]
Downloading 2 / 3
Package tk found in repository Solus
tk-8.6.6-4-1-x86_64.eopkg [cached]
Downloading 3 / 3
Package python3-tkinter found in repository Solus
python3-tkinter-3.5.2-12-1-x86_64.eopkg [cached]
Installing 1 / 3
tcl-8.6.6-5-1-x86_64.eopkg [cached]
Installing tcl, version 8.6.6, release 5
Running pre removal operations for tcl
Running post removal operations for tcl
Extracting the files of tcl
Configuring tcl package
Configured tcl
Installed tcl
Installing 2 / 3
tk-8.6.6-4-1-x86_64.eopkg [cached]
Installing tk, version 8.6.6, release 4
Running pre removal operations for tk
Running post removal operations for tk
Extracting the files of tk
Configuring tk package
Configured tk
Installed tk
Installing 3 / 3
python3-tkinter-3.5.2-12-1-x86_64.eopkg [cached]
Installing python3-tkinter, version 3.5.2, release 12
Running pre removal operations for python3-tkinter
Running post removal operations for python3-tkinter
Extracting the files of python3-tkinter
Configuring python3-tkinter package
Configured python3-tkinter
Installed python3-tkinter
$  python3
Python 3.5.2 (default, Nov 12 2016, 19:04:03) 
[GCC 6.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter              
>>> tkinter._test()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/tkinter/__init__.py", line 3837, in _test
    root = Tk()
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1868, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: unknown color name "BACKGROUND"

No luck

tried

sudo eopkg install --reinstall python3-tkinter tk tcl python3 tcl-devel tk-devel

didn't fix it neither

Workaround
From
http://emc-users.narkive.com/YMOap6SC/btdt-re-background-foreground-not-defined#post10

xrdb -all -query|sed -e 's#[A-Z_]*BACKGROUND# gray90#' \
-e 's#[A-Z_]*FOREGROUND# Black#' \
-e 's#[A-Z_]*HIGHLIGHT# White#' \
-e 's#[A-Z_]*LOWLIGHT# Black#'|xrdb -merge

Macro magic: Seems legit It works

Did this give any hint on how to solve for the distribution?

euoar added a subscriber: euoar.Jun 17 2017, 7:00 AM
euoar added a comment.Jun 17 2017, 7:02 AM

What desktop are you using? Would be interesting knowing if it's Mate, as it might be related to this one: T3560

euoar added a comment.Jun 17 2017, 7:38 PM

@Daniel-at-github Can't reproduce the bug in my system . Is your system fully updated? The bug I reported seems to have been solved with latest updates...

Screenshot (running mate):

Seems related to T3560

It's mate desktop

Tried with:

$ sudo eopkg upgrade
$ xrdb -load /dev/null
$ xrdb -query

seem solved, but after restart the problem persists.

My system gets updated from time to time. Could it be a problem?
eopkg.log dates:

2017-01-01
2017-01-14
2017-01-19
2017-04-10
2017-04-28
2017-06-04
2017-06-05
2017-06-08
2017-06-18
DataDrake closed this task as Resolved.Jul 20 2017, 1:24 AM
DataDrake claimed this task.
DataDrake added a subscriber: DataDrake.

This appears to be fixed in unstable. Feel free to reopen if it is still failing on your system after you have applied all updates.

niihelium added a subscriber: niihelium.EditedMar 20 2018, 4:11 AM

Solus KDE latest ISO with all updates, rebooted:

$ python3
Python 3.6.4 (default, Mar 13 2018, 04:02:38) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> tkinter._test()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/tkinter/__init__.py", line 3982, in _test
    root = Tk()
  File "/usr/lib/python3.6/tkinter/__init__.py", line 2017, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: unknown color name "BACKGROUND"
padraig reopened this task as Open.Oct 8 2018, 11:47 AM
padraig added a subscriber: padraig.

I hope you don't mind me opening this, but this is still the case on MATE.

>>> import tkinter
>>> tkinter._test()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/tkinter/__init__.py", line 3985, in _test
    root = Tk()
  File "/usr/lib/python3.6/tkinter/__init__.py", line 2020, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: unknown color name "BACKGROUND"

This is with a fully up to date system. It can be fixed temporarily with the following two lines:

$ xrdb -load /dev/null
$ xrdb -query

But it is undone after a reboot.

DataDrake added a comment.EditedOct 8 2018, 11:49 AM

I need an explanation for reopening this or I will close it again

EDIT: Timing. Thanks for responding.

DataDrake triaged this task as Normal priority.Oct 16 2018, 4:45 PM
DataDrake edited projects, added Software; removed Lacks Project.
DataDrake closed this task as Resolved.Oct 21 2018, 5:16 PM

Appears to be fixed in Unstable.