[ python-Bugs-1160328 ] urllib2 post error when using httpproxy

SourceForge.net noreply at sourceforge.net
Sun May 28 02:15:42 CEST 2006


Bugs item #1160328, was opened at 2005-03-10 01:37
Message generated for change (Comment added) made by jjlee
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1160328&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: small tiger (xhchen111)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2 post error when using httpproxy

Initial Comment:
==============
program
==============
# -*- coding: gbk -*-
import httplib, urllib, urllib2#, cookielib

proxy = urllib2.ProxyHandler
({'http':'http://pic:iLusalt@proxy.pconline.com.cn:8080'})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)

f = urllib2.urlopen
("http://192.168.10.177:8080/price/login.do?
method=list")
print f.read()

postdata = urllib.urlencode
({'userId':'admin', 'password':'admin'})
request = urllib2.Request
('http://192.168.10.177:8080/price/login.do?
method=login')
response = urllib2.urlopen(request, postdata)
print response.read()

====================
out put
====================
E:\jt>c:\python24\python t.py
Traceback (most recent call last):
  File "t.py", line 13, in ?
    response = urllib2.urlopen(request, postdata)
  File "c:\python24\lib\urllib2.py", line 130, in urlopen
    return _opener.open(url, data)
  File "c:\python24\lib\urllib2.py", line 358, in open
    response = self._open(req, data)
  File "c:\python24\lib\urllib2.py", line 376, in _open
    '_open', req)
  File "c:\python24\lib\urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "c:\python24\lib\urllib2.py", line 1021, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "c:\python24\lib\urllib2.py", line 996, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error (10053, 'Software 
caused connection abort')>

----------------------------------------------------------------------

Comment By: John J Lee (jjlee)
Date: 2006-05-28 01:15

Message:
Logged In: YES 
user_id=261020

The first URL hangs for me, using Firefox.  Especially if
this depends on using a proxy which I do not have permission
to use, I have no idea how to reproduce this.  xhchen111,
are you still around?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1160328&group_id=5470


More information about the Python-bugs-list mailing list