cmkrause
October 12th, 2008, 04:56 AM
I am working on a Python Application as part of my science fair project. Interestingly enough, everything was working fine until suddenly I starting getting the following error:
Traceback (most recent call last):
File "testing with socket.py", line 1, in <module>
import socket
File "C:\Python25\lib\socket.py", line 174, in <module>
Return a new socket object connected to the same system resource."""
File "C:\Python25\lib\socket.py", line 219, in _socketobject
self._rbufsize = bufsize
File "<string>", line 3, in <module>
AttributeError: type object '_socket.socket' has no attribute 'ioctl'
The socket module is being imported when I am import the ftplib module.
I tried an incredibly simple use of the socket module (see below) and I get the same error.
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('modwest.com', 50007))
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
data = conn.recv(1024)
if not data: break
conn.send(data)
conn.close()
Also the simple testing simple and my main script work great on my Ubuntu box. Any ideas of how to fix it in Windows? I know it is a bit odd, but often times it is more convenient to program in Windows since I have multiple monitors setup and then run the code on my Ubuntu server.
Thank you all for your help,
Chris
PS: This is my first post. I have used this site for over a year helping me solve my problems, and now I finally need some more individualized help. Thanks for this great community and great OS.
Traceback (most recent call last):
File "testing with socket.py", line 1, in <module>
import socket
File "C:\Python25\lib\socket.py", line 174, in <module>
Return a new socket object connected to the same system resource."""
File "C:\Python25\lib\socket.py", line 219, in _socketobject
self._rbufsize = bufsize
File "<string>", line 3, in <module>
AttributeError: type object '_socket.socket' has no attribute 'ioctl'
The socket module is being imported when I am import the ftplib module.
I tried an incredibly simple use of the socket module (see below) and I get the same error.
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('modwest.com', 50007))
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
data = conn.recv(1024)
if not data: break
conn.send(data)
conn.close()
Also the simple testing simple and my main script work great on my Ubuntu box. Any ideas of how to fix it in Windows? I know it is a bit odd, but often times it is more convenient to program in Windows since I have multiple monitors setup and then run the code on my Ubuntu server.
Thank you all for your help,
Chris
PS: This is my first post. I have used this site for over a year helping me solve my problems, and now I finally need some more individualized help. Thanks for this great community and great OS.