Message130540
| Author |
caitifbrito |
| Recipients |
caitifbrito |
| Date |
2011年03月11日.02:02:27 |
| SpamBayes Score |
0.0023986155 |
| Marked as misclassified |
No |
| Message-id |
<1299808949.88.0.712644029925.issue11463@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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()
----------------- |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年03月11日 02:02:29 | caitifbrito | set | recipients:
+ caitifbrito |
| 2011年03月11日 02:02:29 | caitifbrito | set | messageid: <1299808949.88.0.712644029925.issue11463@psf.upfronthosting.co.za> |
| 2011年03月11日 02:02:28 | caitifbrito | link | issue11463 messages |
| 2011年03月11日 02:02:27 | caitifbrito | create |
|