IOError: (0,"Error") when closing "os.popen"ed file?

Adrian Eyre a.eyre at optichrome.com
Mon Jan 31 08:45:15 EST 2000


> After hacking for a while, I managed to work around the problem by
> doing:
> 
>     time.sleep(0.1)
>     f.close()
> 
> But this is highly unsatisfactory..... Is there anyone that can give me 
> a better suggestion?

I expect the OS hasn't finished with the file before it receives the
close().

Try replacing "time.sleep(0.1)" with "f.flush()". IIRC flush() blocks
untils the file operation has completed.

--------------------------------------------
Adrian Eyre <a.eyre at optichrome.com>
http://www.optichrome.com 





More information about the Python-list mailing list