title: urljoin when an absolute path does not have a leading slash
body: <p>Some websites like <a href="http://www.gilacountyaz.gov/government/assessor/index.php" rel="nofollow">http://www.gilacountyaz.gov/government/assessor/index.php</a> have a bunch of internal links that should be absolute paths, but do not have the leading slash. When parsing them with <code>urlparse.urljoin</code> the result is the following:</p>
  
  <pre><code>&gt;&gt;&gt; import urlparse
  &gt;&gt;&gt; a = "http://www.gilacountyaz.gov/government/assessor/index.php"
  &gt;&gt;&gt; b = "government/assessor/address_change.php"
  &gt;&gt;&gt; urlparse.urljoin(a, b)
  'http://www.gilacountyaz.gov/government/assessor/government/assessor/address_change.php'
  </code></pre>
  
  <p>This causes a web crawler to not realize it already visited a page, with a potentially infinite loop. Firefox and Chrome are able to spot the problem and resolve correctly to</p>
  
  <pre><code>http://www.gilacountyaz.gov/government/assessor/address_change.php
  </code></pre>
  
  <p>Is there a way to do the same in Python? Note that assuming always a leading slash does not work, because we might be dealing with a genuine relative path.</p>