Bug 110372

Summary: Python/Tkinter does not work because of Python - Tcl/Tk Unicode problem (UCS4 resp. UCS2)
Product: [Fedora] Fedora Reporter: Thomas <pushcold>
Component: pythonAssignee: Mihai Ibanescu <mihai.ibanescu>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 1CC: stephen.walton
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-04-02 13:14:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Thomas 2003-11-18 21:51:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031030

Description of problem:
Tkinter (RPM packacke: tkinter) provides the Python bindings for Tk (a
GUI toolkit; 'Tcl/Tk'). But on Fedora Core 1, Python/Tk does not work
(i.e. you are not able to run any Python application using the Tk
toolkit).

The problem seems to be, that Python was compiled with the UCS4 option
for Fedora Core 1, whereas Tcl/Tk uses UCS2 (i.e. we have a Unicode
representation problem here).

One way to overcome this problem is to get the Python and Tkinter RPM
packages from www.python.org (same version as Python and Tkinter on
Fedora Core 1; i.e. at the moment *not* Python 2.3) and to update
Python and Tkinter on Fedora Core 1 with these packages (rpm -U ...).


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. install the python, tcl, tk, itcl, tix, tkinter RPM packages
2. try to run any Python/Tk application (e.g. 'python Tkinter.py')

    

Additional info:

I think, Tkinter should be installed automatically on any Fedora Core
System (which installs Python). Tkinter is the de facto standard GUI
for Python and many Python programmers rely on it being part of
Python. When installing Python from www.python.org, Tkinter is always
part of the Python distribution. (At the moment, it is 'hidden' on the
Fedora Core CD #3 and depends on some other packages - e.g. itcl, tix
- which have to be installed first.)

Comment 1 Mihai Ibanescu 2003-11-25 00:45:47 UTC
What exactly is the error you're seeing?

Comment 2 Stephen Walton 2003-11-27 17:38:57 UTC
I can answer this because I see it too:

$ python
Python 2.2.3 (#1, Oct 15 2003, 23:33:35)
[GCC 3.3.1 20030930 (Red Hat Linux 3.3.1-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>> Tkinter._test()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 3118, in _test
    label = Label(root, text=text)
  File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 2285, in __init__
    Widget.__init__(self, master, 'label', cnf, kw)
  File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 1780, in __init__
    self.tk.call(
SystemError: Py_UNICODE and Tcl_UniChar differ in size
$ rpm -q python
python-2.2.3-7
$ rpm -q tkinter
tkinter-2.2.3-7

Comment 3 jafo-redhat 2003-12-08 06:11:33 UTC
I've uploaded some 2.3.2 RPMs to the python.org site in the normal
locations for Fedora Core 1.  These seem to run Idle ok, in a quick
test, so they may be worth trying.  http://www.python.org/2.3.2/rpms.html

Sean

Comment 4 Ram Smith 2004-04-02 03:12:28 UTC
What is the status of this bug? I'm getting this error april 2004. I
have just installed fedora Core 1 and have installed all updates.

Cheers,

ram.

Comment 5 Mihai Ibanescu 2004-04-02 13:14:54 UTC
This has been fixed in Fedora Core 2 test 1, which ships Python 2.3.3
and tcl/tk 8.4

Sorry, this bug is still in NEEDINFO and didn't appear in my queries.
My fault.

Comment 6 Stephen Walton 2004-04-02 15:48:21 UTC
Sorry I didn't respond sooner:  for a more immediate fix, I was able
to install the python 2.2.3-26 and tkinter 2.2.3-26 rpms from
http://www.python.org/2.2.3/rpms.html;  while they are labeled as
being for RH9 they seem to work fine on FC1.