homepage

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.

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:29caitifbritosetrecipients: + caitifbrito
2011年03月11日 02:02:29caitifbritosetmessageid: <1299808949.88.0.712644029925.issue11463@psf.upfronthosting.co.za>
2011年03月11日 02:02:28caitifbritolinkissue11463 messages
2011年03月11日 02:02:27caitifbritocreate

AltStyle によって変換されたページ (->オリジナル) /