Timeout to readline()/readlines()

Horta danilo.horta at gmail.com
Mon Mar 19 09:50:48 EDT 2007


      Hi folks,
  Sometimes, when I do an os.popen*(), the process executed by the
command hangs, and the script stops forever on the readline()/
readlines() calls. I found that I can use select, but I'm thinking...
if, after a sellect() call returns, the stdout (for example) has more
than one line? or if it has just some characters, no newline, and the
process just hangs?

  I just want a readline(timeout) and readlines(timeout) like
functions. Do I need to create my owns or there're already
implemented?

  Thanks.




More information about the Python-list mailing list