Type problem on Windows

Jerome Chan eviltofu at rocketmail.com
Sat Jun 10 12:47:26 EDT 2000


I am using Pythonwin with win32-129, MacPython 1.5.2c1, and Linux Python 
1.5.2.

While working on some socket stuff, I check the input parameters to some 
function which expects a socket. The code I use is:


def sendData(self,data,s):
  if type(s)!=socket.SocketType:
    raise TypeError,"S "+str(type(s))+" is not a socket."
  ... more code ...


On Unix and Mac, this works. On Win98, this bombs.

I get the following Exception Message


S <type 'instance'> is not a socket.


Running under the Python Interpreter I do:


import socket
x = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
print (x)


Windows98 gives me <type 'instance'>
Unix and Mac gives me <type 'socket'>


Is there a workaround for this? And should this be reported as a bug?



More information about the Python-list mailing list