robmcmullen/peppy — Issue #608: Strange logfile error when running with -d flag
Author: robmcmullen
Created: 2012-02-21 06:00:18+00:00
State: open
Labels: application

*[Trac time 20090416 153029Z]* Only on my test account when I run `peppy -d` do I see the following traceback whenever a debug print is generated (this particular case occurs when popping up the code explorer sidebar, but anything that generates debug printing will produce a similar error):
```
Traceback (most recent call last):
File "/home/gnutella/lib/python2.5/site-packages/peppy-0.9.14-py2.5.egg/peppy/lib/springtabs.py", line 238, in OnLeftDown
self.GetParent().setRadio(self)
File "/home/gnutella/lib/python2.5/site-packages/peppy-0.9.14-py2.5.egg/peppy/lib/springtabs.py", line 354, in setRadio
self.popupItem(item)
File "/home/gnutella/lib/python2.5/site-packages/peppy-0.9.14-py2.5.egg/peppy/lib/springtabs.py", line 364, in popupItem
dprint("Popping up %s" % item.GetLabel())
File "/home/gnutella/lib/python2.5/site-packages/peppy-0.9.14-py2.5.egg/peppy/debug.py", line 84, in dprint
writeToLog(dlogfh, str)
File "/home/gnutella/lib/python2.5/site-packages/peppy-0.9.14-py2.5.egg/peppy/debug.py", line 75, in writeToLog
logfh.write("%s:%d %s%s: %s%s" % (os.path.basename(caller[1]),caller[2],cls,caller[3],text,os.linesep))
IOError: [Errno 0] Error
```
I added some debug printing, and it seems like the file handle is actually open:
```
logfh=', mode 'w' at 0x7f1114356210>
text=Popping up Code Explorer
```