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.
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:14 | admin | set | github: 55672 |
| 2011年03月19日 08:39:47 | orsenthil | set | status: pending -> closed messages: + msg131401 resolution: not a bug nosy: terry.reedy, orsenthil, hdiogenes, caitifbrito |
| 2011年03月19日 05:31:54 | terry.reedy | set | status: open -> pending nosy: terry.reedy, orsenthil, hdiogenes, caitifbrito |
| 2011年03月19日 05:31:26 | terry.reedy | set | status: pending -> open versions: - Python 2.6 nosy: + terry.reedy messages: + msg131394 |
| 2011年03月12日 06:53:22 | orsenthil | set | status: open -> pending nosy: + orsenthil messages: + msg130664 assignee: orsenthil stage: resolved |
| 2011年03月11日 02:57:35 | hdiogenes | set | nosy:
hdiogenes, caitifbrito type: resource usage -> behavior messages: + msg130542 components: + Library (Lib) |
| 2011年03月11日 02:07:48 | caitifbrito | set | nosy:
+ hdiogenes |
| 2011年03月11日 02:02:28 | caitifbrito | create | |