Errno 9] Bad file descriptor

MRAB python at mrabarnett.plus.com
Thu Jul 15 20:07:33 EDT 2010


joblack wrote:
>> Where does the error occur? If Cameron is right, it occurs somewhere
>> completely different, when serializer.dump() is already long done, when
>> some unsuspecting fool tries to do something with serializer.outf (such
>> as closing it)
> I have found it but still I don't get it.
> 
> Dump looks like this:
> 
> ...
> 
> File "C: ... ineptpdf8.4.20.pyw", line 1266, in initialize return
> self.initialize_fopn(docid, param)
> File "C: ... ineptpdf8.4.20.pyw", line 1411, in initialize_fopn print
> buildurl
> 
> IOError: [Errno 9] Bad file descriptor
> 
> Two strange things:
> 
> 1st: in the buildurl is only the url (as a string) to open (something
> like http://www.serverblaba.com/asdfasdf?wdfasdf=4&awfwf=34 ...)
> 2nd: it works if I start in in IDLE, it doesn't work if I double klick
> on the .pyw file.
> 
> How can printing out a string throw a IOError exception? I'm quite
> puzzled.

The extension .pyw says to run the script without opening a console
window. If there's no console, the script can't print to it. Result?
IOError exception.



More information about the Python-list mailing list