Description of problem: Python exits with the following error: python: ./Modules/_tkinter.c:941: AsObj: Assertion `size < size * sizeof(Tcl_UniChar)' failed. Aborted Version-Release number of selected component (if applicable): python-2.5-12.fc7 tkinter-2.5-12.fc7 How reproducible: Always. Steps to Reproduce: 1. Put the following script in t.py: # -*- coding: utf-8 -*- import sys, Tkinter, unicodedata reload(sys) # restore module sys from disk sys.setdefaultencoding('utf-8') # or whatever codec you need del sys.setdefaultencoding # ensure against later accidents Tkinter.Button(text=u"", command=sys.exit).pack( ) Tkinter.mainloop( ) 2. run the program as: python t.py Actual results: python: ./Modules/_tkinter.c:941: AsObj: Assertion `size < size * sizeof(Tcl_UniChar)' failed. Aborted Expected results: A button window containing no text. Additional info:
The script contains some extra cruft. This simplification also generates the error: import sys, Tkinter Tkinter.Button(text=u"", command=sys.exit).pack( ) Tkinter.mainloop( )
I can confirm this with python/tkinter tkinter-2.5.1-11.fc8. Is this problem easy to fix? It's preventing pysol (bug 312701) from running properly.
I forgot to mention, this bug is not present when manually compiling Python: http://sourceforge.net/forum/forum.php?thread_id=1759959&forum_id=503709 Probably something we are passing to %configure or a patch is introducing the bug.
The bug is present in multiple other widgets. For instance, import sys, Tkinter Tkinter.Text(text=u"").pack( ) Tkinter.mainloop( )
Here's a patch, which I've also supplied to bugs.python.org: --- Python-2.5-fc7/Modules/_tkinter.c 2006-08-11 22:33:36.000000000 -0400 +++ Python-2.5/Modules/_tkinter.c 2007-10-18 18:44:40.000000000 -0400 @@ -938,7 +938,7 @@ #if defined(Py_UNICODE_WIDE) && TCL_UTF_MAX == 3 Tcl_UniChar *outbuf; Py_ssize_t i; - assert(size < size * sizeof(Tcl_UniChar)); + assert(size == 0 || size < size * sizeof(Tcl_UniChar)); outbuf = (Tcl_UniChar*)ckalloc(size * sizeof(Tcl_UniChar)); if (!outbuf) { PyErr_NoMemory();
This should now be fixed, please test.
I didn't see anything in bodhi about this so I pulled the packages from koji (http://koji.fedoraproject.org/koji/buildinfo?buildID=21649) and update; pysol at least works without problems now. Could this fix please make it into F8? There may still be time to slide it in before the absolute freeze.
It seems that it's just not that easy to find pending updates in bodhi because there are a bunch of hits on python and the result list is neither sorted nor sortable. The update is at https://admin.fedoraproject.org/updates/F7/pending/python-2.5-14.fc7 I've commented there.
I didn't know where to find the changed version until comment #7. The URL in comment #8 refused my credentials. Now that I've installed *-2.5-14.fc7*, things are working fine for me. If there is a specified testing regimen I should follow, please give a URL for that. Thanks.
We need this fix in F8 as well.
python-2.5-14.fc7 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update python'
# yum --enablerepo=updates-testing update python google 100% |=========================| 951 B 00:00 fedora 100% |=========================| 2.1 kB 00:00 updates-testing 100% |=========================| 2.3 kB 00:00 primary.sqlite.bz2 100% |=========================| 141 kB 00:00 updates 100% |=========================| 2.3 kB 00:00 adobe-linux-i386 100% |=========================| 951 B 00:00 Setting up Update Process Could not find update match for python No Packages marked for Update
python-2.5-14.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.