Output to file gets lost - don't know where to look ...

uair01 spooklight at gmail.com
Sun Dec 14 16:35:44 EST 2008


I'm running python in IDLE on suse11.

I have a python program and after writing 100kB to 200kB to a file,
the write statements seem to stop working.
Basically the print statements look like this:

some loops:
logFile.write(string1)
logFile.write(string2)
end of loops

print(stringA)
logFile.write(string3)
logFile.write(string4)
print(stringB)

String1 and sometimes string2 / string3 (or a part of it) will end up
in the file, but string4 not.
stringsA and stringB get printed to the concole as expected.

Stepping through the program with a debugger shows that *all* write-
statements get executed.

I use several logFile.flush() statements and a logFile.close() at the
end.

Is there some kind of file-size-limit or some kind of memory or buffer
problem? Or could it be a bug in IDLE? I don't know where to look
further.

OH ... maybe just writing this message has helped. Now I see the
following error messages inside the window from where I started IDLE.
Could that be the cause?

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__
    return self.func(*args)
  File "/usr/lib/python2.5/idlelib/MultiCall.py", line 151, in handler
    r = l[i](event)
  File "/usr/lib/python2.5/idlelib/CallTips.py", line 62, in
refresh_calltip_event
    self.open_calltip(False)
  File "/usr/lib/python2.5/idlelib/CallTips.py", line 65, in
open_calltip
    self._remove_calltip_window()
  File "/usr/lib/python2.5/idlelib/CallTips.py", line 41, in
_remove_calltip_window
    self.calltip.hidetip()
  File "/usr/lib/python2.5/idlelib/CallTipWindow.py", line 126, in
hidetip
    self.label.destroy()
AttributeError: 'NoneType' object has no attribute 'destroy'

I will try the python program outside of IDLE.



More information about the Python-list mailing list