non-blocking sys.stdin.read() on win32?

Michal Wallace sabren at manifestation.com
Sun Jan 20 20:01:29 EST 2002


Hi all.

I'm making a replacement for rsh/ssh to be used by cvs's
-d:ext: option.. CVS opens my program and sends data to it
as if it were rsh. My program sends that data to a socket
and then reads the response, which comes from a cvs server.

Everything seems to work fine, but it's INCREDIBLY slow,
because I only read one line at a time from stdin (the local
cvs parent process):

>>> local_msg = sys.stdin.readline()

I want to just be able to call select() on sys.stdin and
then, if appropriate, read more than one line of, but it
doesn't let me, because on win32, python's select() only
works for sockets.

What can I do?

(I'm not above using a C extension if that's what it takes,
but I'm not much of a C programmer)

Cheers,

- Michal   http://www.sabren.net/   sabren at manifestation.com
------------------------------------------------------------
Give your ideas the perfect home: http://www.cornerhost.com/
 cvs - weblogs - php - linux shell - perl/python/cgi - java
------------------------------------------------------------





More information about the Python-list mailing list