classification
Title: urllib2 post error when using httpproxy
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 3.2, Python 3.1, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: jjlee, orsenthil, xhchen111
Priority: normal Keywords:

Created on 2005-03-10 01:37 by xhchen111, last changed 2010-08-21 12:36 by BreamoreBoy.

Messages (2)
msg60697 - (view) Author: small tiger (xhchen111) Date: 2005-03-10 01:37
==============
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')>
msg60698 - (view) Author: John J Lee (jjlee) Date: 2006-05-28 00:15
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?
History
Date User Action Args
2010-08-21 12:36:55BreamoreBoysetversions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6
2009-02-12 17:40:26ajaksu2setnosy: + orsenthil
stage: test needed
type: behavior
versions: + Python 2.6, - Python 2.4
2005-03-10 01:37:13xhchen111create