urllib.urlopen on win32

Bill Scherer Bill.Scherer at VerizonWireless.com
Thu Jul 27 13:16:51 EDT 2000


I'got some code that calls urlopen with a dictionary to do a
POST request.
It works fine on Linux, but on WinNT, I get a 10054 winsock error
("Connection reset by peer") on line 117:

File "C:\Program Files\Python\Lib\plat-win\socket.py", line 117, in
readline
    new = self._sock.recv(self._rbufsize)
IOError: [Errno socket error] (10054, 'winsock error')


If I remove the dictionary to do a GET, then it works.

The code looks more less like the following:

data = urllib.urlencode(<some dict of stuff>)
url = "http://server:9999"
result = urllib.urlopen(url, data)
html = result.read()

The server is a Python http server derived from BaseHTTPserver.

Any ideas?

Thanks!

--
William K. Scherer
Sr. Member of Applications Staff - Verizon Wireless
Bill.Scherer_at_VerizonWireless.com







More information about the Python-list mailing list