[New-bugs-announce] [issue11463] IncompleteRead: IncompleteRead(168 bytes read)

Luís Antônio Araújo de Brito report at bugs.python.org
Fri Mar 11 03:02:29 CET 2011


New submission from Luís Antônio Araújo de Brito <luis at multmeio.com.br>:

Hi folks,
    I have an app that talk with cPanel for create/suspend/unsuspend/kill domaind.. So when I use the urllib2 to get response for cPanel and read it. It show the IncompleteRead except. 
    I get the same URL in a browser and the response is ok. With lib it's broked.

The Code Sample
------------------
auth = "WHM my_user:%s" % "HASHHASHHASHHASH"
_opener = urllib2.build_opener()
_opener.addheaders = [('Authorization', auth)]

url = "http://my_cpanel_url/scripts/remote_suspend?user=%s" % "user_on_cpanel_name"
try:
    f = _opener.open(url)
except urllib2.HTTPError, e:
    raise OperationError(e)
result = f.read() # <-- IncompleteRead except HERE
f.close()
print result.strip()
-----------------

----------
messages: 130540
nosy: caitifbrito
priority: normal
severity: normal
status: open
title: IncompleteRead: IncompleteRead(168 bytes read)
type: resource usage
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11463>
_______________________________________


More information about the New-bugs-announce mailing list