title: Python: AssertionError: proxies must be a mapping
body: <p>I get this error :</p>
  
  <pre><code>Traceback (most recent call last):
    File "script.py", line 7, in &lt;module&gt;
      proxy = urllib2.ProxyHandler(line)
    File "/usr/lib/python2.7/urllib2.py", line 713, in __init__
      assert hasattr(proxies, 'has_key'), "proxies must be a mapping"
  AssertionError: proxies must be a mapping
  </code></pre>
  
  <p>when I run the following script: </p>
  
  <pre><code>import urllib2  
  u=open('urls.txt')
  p=open('proxies.txt')
  for line in p:
      proxy = urllib2.ProxyHandler(line)
      opener = urllib2.build_opener(proxy)
      urllib2.install_opener(opener)
      for url in u:
          urllib.urlopen(url).read()
  
  u.close()
  p.close()
  </code></pre>
  
  <p>my urls.txt file has this:</p>
  
  <pre><code>'www.google.com'
  'www.facebook.com'
  'www.reddit.com'
  </code></pre>
  
  <p>and my proxies.txt has this: </p>
  
  <pre><code>{'https': 'https://94.142.27.4:3128'}
  {'http': 'http://118.97.95.174:8080'}
  {'http':'http://66.62.236.15:8080'}
  </code></pre>
  
  <p>I found them at <a href="http://www.hidemyass.com/proxy-list/search-225490" rel="nofollow">hidemyass.com</a></p>
  
  <p>from the googling I have done, most people that have had this problem have their proxies formatted wrong. Is this the case here?</p>