Re: miniedit.py

Guido van Rossum (Guido.van.Rossum@cwi.nl)
Mon, 31 Aug 1992 10:56:35 +0200

>I'm trying to get miniedit.py to run.
>My system particulars are as follows:
>
>SunOS 4.1.2
>OpenWindows 3.0
>Python 0.9.7beta
>Stdwin 0.9.7 (X11 port)
>
>I'm trying to run the application directly from a shell (via the #!
>mechanism). The application puts up its window, but doesn't load the
>file given on the command line and does not seem to respond to input
>events. I'm able to kill it by generating a SIGINT in the shell I
>start it from and move the mouse cursor into the application window.

I'm sorry: there's a bug in 0.9.7beta version (that's why it's a
beta version!), which make it think that certain objects are "false"
when they should actually be considered "true".

There have been several releases labeled "0.9.7beta", and I'm not sure
the current version still has the bug in it -- there's another bug I
need to hunt down before I dare to make a new beta release. Anyway,
here's a description of a fix. Edit the file "ceval.c" and find the
definition of function testbool(). There is a sequence of code ending
like this:

else if (v->ob_type->tp_as_sequence != NULL)
res = (*v->ob_type->tp_as_sequence->sq_length)(v);
else
res = 0;

The 0 in the last line should be a 1. That's all there is to the fix!

Happy hacking...

(BTW, I'm extremely glad that you listed your environment so carefully
-- without it I would have had a hard time this was for real.)

--Guido van Rossum, CWI, Amsterdam <guido@cwi.nl>
"I'm sorry, is this a five-minute argument, or the full half-hour?"