Bug 110372 - Python/Tkinter does not work because of Python - Tcl/Tk Unicode problem (UCS4 resp. UCS2)
Python/Tkinter does not work because of Python - Tcl/Tk Unicode problem (UCS4...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
1
All Linux
medium Severity high
: ---
: ---
Assigned To: Mihai Ibanescu
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-18 16:51 EST by Thomas
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-02 08:14:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Thomas 2003-11-18 16:51:49 EST
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-24 19:45:47 EST
What exactly is the error you're seeing?
Comment 2 Stephen Walton 2003-11-27 12:38:57 EST
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 01:11:33 EST
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-01 22:12:28 EST
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 08:14:54 EST
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 10:48:21 EST
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.

Note You need to log in before you can comment on or make changes to this bug.