label empty or too long - python urllib2
I am having a strange situation: i am curling urls like this: def check_urlstatus(url): h = httplib2.Http() try: resp = h.request("http://" + url, 'HEAD') if int(resp[0]['status']) < 400: return 'ok' else: return 'bad' except httplib2.ServerNotFoundError: return 'bad' if I try to test this with: if check_urlstatus('.f.de') == "bad": #<--- error happening here #.. #.. it is saying: UnicodeError: label empty or too long what is the problem i am causing here? EDIT : here is the traceback with idna. I guess, it tries to split the input by . and in this case, first label is empty which is the pace