title: label empty or too long - python urllib2
body: <p>I am having a strange situation: </p>
  
  <p>i am curling urls like this: </p>
  
  <pre><code>def check_urlstatus(url):
    h = httplib2.Http()
    try:
        resp = h.request("http://" + url, 'HEAD')        
        if int(resp[0]['status']) &lt; 400:
            return 'ok'
        else:
            return 'bad'
    except httplib2.ServerNotFoundError:
        return 'bad'
  </code></pre>
  
  <p>if I try to test this with: </p>
  
  <pre><code>if check_urlstatus('.f.de') == "bad": #&lt;--- error happening here
     #..
     #..
  </code></pre>
  
  <p>it is saying: </p>
  
  <pre><code>UnicodeError: label empty or too long
  </code></pre>
  
  <p>what is the problem i am causing here? </p>
  
  <p><strong>EDIT</strong>: here is the traceback with idna. I guess, it tries to split the input by <code>.</code> and in this case, first label is empty which is the pace before the first <code>.</code>. </p>
  
  <p><img src="https://i.stack.imgur.com/4bO4H.png" alt="enter image description here"></p>