Note: I am using the _unstable_ branch of Gentoo 1.2. Tkinter.py coming with Python 2.2.2 seems to have problems with tcltk 8.4.2. It might be the problem reported at http://sourceforge.net/tracker/index.php?func=detail&aid=698517&group_id=5470&atid=105470 It can be seen when playing app-games/pysol. The application crashes as soon as you move the mouse to the menu area. Or just start idle.py and choose File/New Window Reproducible: Always Steps to Reproduce: 1. emerge app-games/pysol 2. start the game 3. move the mouse to the menu are 1. start idle.py 2. try open a new window Actual Results: $ pysol Traceback (most recent call last): File "pysol.py", line 19883, in ? File "pysol.py", line 19881, in main File "pysol.py", line 19854, in pysol_main File "pysol.py", line 2382, in __init__ File "pysol.py", line 2332, in mainloop File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 937, in mainloop self.tk.mainloop(n) File "pysol.py", line 1820, in CallWrapper____call__ File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 1032, in _substitute e.num = getint(b) ValueError: invalid literal for int(): ?? Expected Results: hours of fun playing pysol $ emerge info Portage 2.0.47-r10 (default-1.0, gcc-2.95.3, glibc-2.2.5-r4,2.2.5-r8) ================================================================= System uname: 2.4.20-xfs-r2 i686 AMD Athlon(tm) Processor GENTOO_MIRRORS="http://gentoo.oregonstate.edu/ http://distro.ibiblio.org/pub/Linux/distributions/gentoo" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" PORTDIR="/usr/portage" DISTDIR="/usr/portage/distfiles" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR_OVERLAY="" USE="x86 oss 3dnow apm avi crypt cups encode jpeg libg++ mikmod mmx mpeg ncurses pdflib quicktime spell truetype xml2 xmms xv arts berkdb bonobo cdr esd gdbm gif gnome gnome-libs gpm gtk guile imlib java kde libwww motif mozilla mysql nls oggvorbis opengl pam perl png python qt readline scanner sdl slang snmp ssl svga tcltk tcpd tetex tiff X xfs apache2" COMPILER="" CHOST="i686-pc-linux-gnu" CFLAGS="-march=i686 -O3 -pipe" CXXFLAGS="-march=i686 -O3 -pipe" ACCEPT_KEYWORDS="x86 ~x86" MAKEOPTS="-j2" AUTOCLEAN="yes" SYNC="rsync://rsync.gentoo.org/gentoo-portage" FEATURES="sandbox ccache"
I dont even have Tkinter. humpback@sam humpback $ pysol Traceback (most recent call last): File "pysol.py", line 117, in ? File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 35, in ? import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter PySol cannot find the Tkinter Python libraries. Please check your Python installation.
Please recompile your python. Tkinter is probably linked against old tcl. I am working on recompile script, which can fix it generally.
Recompiling Python does not help with the "invalid literal for int" problem. I tried that already.
As expected, downgrading tcl/tk to 8.3.4 made idle.py and pysol work again. So it seems not to be a compile/link problem.
Please look at following URL. It declares to be a fixed version for tk-8.4.2. http://www.oberhumer.com/opensource/pysol/Tkinter.py and info at http://www.oberhumer.com/opensource/pysol/
Complete thread with fix is in Python bug tracker: http://sourceforge.net/tracker/index.php?func=detail&aid=707701&group_id=5470&atid=305470 Fix should be >=tk-8.4.2 only.
Created attachment 11586 [details, diff] tkinter-alternate.patch
Created attachment 11587 [details, diff] python-2.2.2-r1.diff There is an ebuild patch. Pysol works for me with both tk-8.3.4 and tk-8.4.2. Proposed ChangeLog entry: Fixed Tkinter crash with tk-8.4.2 (bug #20318, Python bugs #698517 and #707701). Must be marked as stable before tk-8.4.2. Because python is a critical package, I expect confirmation from (or commit by) any senior developer.
i've committed a python-2.2.2-r1 with the fix that you have there, Stanislav. it is currently masked and marked unstable for all archs, although i'm pretty sure there will be no problems with it. it'll probably be unmasked in 2 days time and live in unstable until tcl/tk-8.4.x is marked as stable.
I have tested it also with tk-8.3, so the fix should be compatible with both out tk's.
*** Bug 20872 has been marked as a duplicate of this bug. ***
new python with tk 8.4.2 patch is now in ~x86.