This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IncompleteRead: IncompleteRead(168 bytes read)
Type: behavior Stage: resolved
Components: Library (Lib) Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: caitifbrito, hdiogenes, orsenthil, terry.reedy
Priority: normal Keywords:

Created on 2011-03-11 02:02 by caitifbrito, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg130540 - (view) Author: Luís Antônio Araújo de Brito (caitifbrito) Date: 2011-03-11 02:02
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()
-----------------
msg130542 - (view) Author: Humberto Diógenes (hdiogenes) * Date: 2011-03-11 02:57
Luís, please analyse the response from the web server to see if it really is a valid HTTP response - AFAIK CPanel web services do not always give valid HTTP responses.
msg130664 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2011-03-12 06:53
Yes, please ensure that server is returning a proper HTTP response. Test it against browser or curl and see if they work. If they work, then it needs to be investigated as why 'http.client' is not working.
msg131394 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-03-19 05:31
2.6 is only open for security issues, so any verification should use later version.
msg131401 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2011-03-19 08:39
Since the reporter did not get back with more details (testing against curl or a HEAD output to eliminate server issues), I am closing this issue.
History
Date User Action Args
2022-04-11 14:57:14adminsetgithub: 55672
2011-03-19 08:39:47orsenthilsetstatus: pending -> closed

messages: + msg131401
resolution: not a bug
nosy: terry.reedy, orsenthil, hdiogenes, caitifbrito
2011-03-19 05:31:54terry.reedysetstatus: open -> pending
nosy: terry.reedy, orsenthil, hdiogenes, caitifbrito
2011-03-19 05:31:26terry.reedysetstatus: pending -> open
versions: - Python 2.6
nosy: + terry.reedy

messages: + msg131394
2011-03-12 06:53:22orsenthilsetstatus: open -> pending

nosy: + orsenthil
messages: + msg130664

assignee: orsenthil
stage: resolved
2011-03-11 02:57:35hdiogenessetnosy: hdiogenes, caitifbrito
type: resource usage -> behavior
messages: + msg130542
components: + Library (Lib)
2011-03-11 02:07:48caitifbritosetnosy: + hdiogenes
2011-03-11 02:02:28caitifbritocreate