开发者

AppEngine no host given exception

开发者 https://www.devze.com 2023-01-18 13:27 出处:网络
I\'ve got a Python app, that uses urllib.urlopen. It works fine on dev_appserver.py, but throws [Errno http error] no host given error on my GAE production server. The code is exactly the same, the ur

I've got a Python app, that uses urllib.urlopen. It works fine on dev_appserver.py, but throws [Errno http error] no host given error on my GAE production server. The code is exactly the same, the url, it connects to, is hardcoded. I'm out of ideas, what could be wrong.

UPD: the code:

def getPic(url):
    sock = urllib.urlopen("http://www.quicklatex.com/latex.f?formula="+(url.replace("&", "&")))
    if "开发者_如何学Python0" in sock.readline() :
     return sock.readline().partition(" ")[0]
    else:
     return ""

It fetches the page, returned by quicklatex.com website. First line contains of number of errors, second -- of link to the generated image, followed by space and a number. I'm fetching the url of the picture. The url variable itself contains some LaTeX code.


Have you tried reviewing the URL Fetch documentation? Can you show us the URL?

0

精彩评论

暂无评论...
验证码 换一张
取 消