[issue1301] Bad assertion in _tkinter.c

2008-01-03 Thread Stephen P. Schaefer

Stephen P. Schaefer added the comment:

Mr. van Rossum's patch, applied to the Fedora 7 .src.rpm, is working for me.

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1301>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1301] Bad assertion in _tkinter.c

2008-01-03 Thread Stephen P. Schaefer

Stephen P. Schaefer added the comment:

It looks good to me (to the extent that means anything).  I'm doing an
rpmbuild now with your patch applied to the Fedora 7 .src.rpm, and I'll
start using the result on my workstation ASAP.

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1301>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1301] Bad assertion in _tkinter.c

2008-01-03 Thread Stephen P. Schaefer

Stephen P. Schaefer added the comment:

I'm not sure of the scope of the "block" to which you're referring.  As
patched, the code returns a Tcl_Obj representing 0 length unicode
string, which appears to me to be the correct behavior, and works for
the applications I use (originally developed in python 2.3 and python
2.4).  I doubt that it's worth special-casing away the call for a 0
length outbuf, the skipped for loop, plus the call to free the 0 length
outbuf.

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1301>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1301] Bad assertion in _tkinter.c

2007-10-18 Thread Stephen P. Schaefer

New submission from Stephen P. Schaefer:

The following fails with python 2.5 as built by Fedora 7:

t2.py:
import sys, Tkinter
Tkinter.Button(text=u"").pack( )
Tkinter.mainloop( )

$ python t2.py
python: ./Modules/_tkinter.c:941: AsObj: Assertion `size < size *
sizeof(Tcl_UniChar)' failed.
Aborted

The following patch corrects the problem:

--- Python-2.5-fc7/Modules/_tkinter.c   2006-08-11 22:33:36.0 -0400
+++ Python-2.5/Modules/_tkinter.c   2007-10-18 18:44:40.0 -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();

--
components: Tkinter
messages: 56546
nosy: thyrsus
severity: normal
status: open
title: Bad assertion in _tkinter.c
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1301>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com