Note that there are some explanatory texts on larger screens.

plurals
  1. POPython httplib2 AttributeError: 'builtin_function_or_method' object has no attribute 'new'
    text
    copied!<p>I am trying to scrape text from wikipedia. Since httplib2 is already installed, I thought I would use it.</p> <p>When I go through the simple retrieval from their <a href="http://code.google.com/p/httplib2/wiki/Examples" rel="nofollow">basic examples</a>, the first example gives me this error.</p> <pre><code>&gt; import httplib2 &gt; h = httplib2.Http(".cache") &gt; url = "http://code.google.com/p/httplib2/" &gt; h.request(url, "GET") Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/httplib2/__init__.py", line 978, in request cached_value = self.cache.get(cachekey) File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/httplib2/__init__.py", line 625, in get cacheFullPath = os.path.join(self.cache, self.safe(key)) File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/httplib2/__init__.py", line 189, in safename filemd5 = md5.new(filename).hexdigest() AttributeError: 'builtin_function_or_method' object has no attribute 'new' </code></pre> <p>I'm running on Mac OS X, Python Version: 7.2-2 (64-bit), Enthought Distribution.</p> <p>I'm thinking it might be an issue with a faulty installation, but then again httplib2 came installed with other packages that I've been using. Also, I could try to reinstall httplib2, but I'm hesitant to do that, thinking it might break other things that are currently working.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload