set_proxy in urllib2 is driving my crazy

est electronixtar at
Mon Jul 23 11:50:17 CEST 2007

A simple py script

import urllib2
print urllib2.urlopen(req).read()

Here is error:

 "C:\Python25\python.exe" -u "E:\Python\Crawler\"

Traceback (most recent call last):
  File "E:\Python\Crawler\", line 4, in <module>
    print urllib2.urlopen(req).read()
  File "C:\Python25\lib\", line 121, in urlopen
    return, data)
  File "C:\Python25\lib\", line 374, in open
    response = self._open(req, data)
  File "C:\Python25\lib\", line 392, in _open
    '_open', req)
  File "C:\Python25\lib\", line 353, in _call_chain
    result = func(*args)
  File "C:\Python25\lib\", line 1101, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "C:\Python25\lib\", line 1076, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error (10054, 'Connection reset by peer')>

I built a proxy with CCproxy 6.3.2 on my own machine, and it's working
absolutely all right, but how can my simple python script go wrong ?

More information about the Python-list mailing list