Is There A Problem With makefile() On Win32?

J

John Abel

Hi,

I've a small script, which listens to a port on a remote machine. I'm
trying to implement makefile. However, the code on Win32 Py 2.2.2

def _Connect( self ):
sockConn = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
try:
sockConn.connect( ( self.remoteMachine, self.remotePort ) )
except socket.error, ErrorMsg:
print "Got Me An Error"

print "Going To Run MakeFile"
sockFile = sockConn.makefile( 'r' )
for tcpData in sockFile:
print tcpData

produces this:

for tcpData in sockFile:
TypeError: iteration over non-sequence

On linux, it just sits there, ignoring the incoming data. Py 2.3.1 on
linux/OSX works OK (I haven't got round to testing 2.3.1 on Win32). I've
checked the docs for 2.2.3/2.3.1, and can't find anything to say it
shouldn't work. My question then, is it fixed on 2.2.3, and will it work on
Win32 (I have to develop scripts to run on Win32/linux/OSX)?

Regards

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top