[Pythonmac-SIG] Wierd Output window bug in BuildApplication
Chris Barker
cbarker@jps.net
Wed, 19 Jul 2000 10:01:17 -0700
Jack Jansen wrote:
> > I seem to have narrowed it down to when I open and wrote to a file. If I
> > open and write to a file, the output window appears, if not, it doesn't.
> > There is nothing in the output window.
> Hmm, strange. The output window is opened (if you have the "delay
> until needed" bit set) only if something is written to it or read from
> it.
Well, I tried getting rid of the code that wrote a temp file, and used
an in-memory version, but it still happened. Then I realised that part
of what the app does is FTP a file selected by the user, and ftplib
needs an open file object passed to it, so there is no way to get around
opening a file, which is when the window seems to pop up.
> What you could try is closing stdin/stdout/stderr, or redirecting
> them to some other place. If that fixes the problem then the problem
> is probably in Python (as it goes away when you make it impossible for
> Python code to get at the sioux window),
well, I tried:
sys.stdout = None (and similarly for stdin/stderr)
I also tried redirecting them to a file:
sys.stdout = open('tempfile','w')
etc..
Neither of these makes a difference.
> if it doesn't go away it is
> probably in the C code somewhere.
There you have it. Remember that it ONLY happens with an app built with
BuildApplication, If I drag and drop the script onthe interpretter, it
doesn't bring up the window.
> I assume this is using 1.5.2? You could also try it under 1.6alfa and
> see what happens there...
See my other post for the results of my attempt to do this. The short
version is that I don't know, because I couldn't get EditPythonPrefs to
work.
-Chris
--
Christopher Barker,
Ph.D.
cbarker@jps.net --- --- ---
http://www.jps.net/cbarker -----@@ -----@@ -----@@
------@@@ ------@@@ ------@@@
Water Resources Engineering ------ @ ------ @ ------ @
Coastal and Fluvial Hydrodynamics ------- --------- --------
------------------------------------------------------------------------
------------------------------------------------------------------------