title: Python CouchDB can't save dict created from feedparser entry? (no attribute 'read')
body: <p>I have a script that I want to read entries in an RSS feed and store the individual entries in JSON format into a CouchDB database.</p>
  
  <p>The interesting part of my code looks something like this:</p>
  
  <pre><code>Feed = namedtuple('Feed', ['name', 'url'])
  
  couch = couchdb.Server(COUCH_HOST)
  couch.resource.credentials = (COUCH_USER, COUCH_PASS)
  
  db = couch['raw_entries']
  
  for feed in map(Feed._make, csv.reader(open("feeds.csv", "rb"))):
      d = feedparser.parse(feed.url)
      for item in d.entries:
          db.save(item)
  </code></pre>
  
  <p>When I try to run that code, I get the following error from the <code>db.save(item)</code>:</p>
  
  <pre><code>AttributeError: object has no attribute 'read'
  </code></pre>
  
  <p>OK, so I then did a little debugging...</p>
  
  <pre><code>for feed in map(Feed._make, csv.reader(open("feeds.csv", "rb"))):
      d = feedparser.parse(feed.url)
      for item in d.entries:
          print(type(item))
  </code></pre>
  
  <p>results in <code>&lt;class 'feedparser.FeedParserDict'&gt;</code> -- ahh, so feedparser is using its own dict type... well, what if I try explicitly casting it to a <code>dict</code>?</p>
  
  <pre><code>for feed in map(Feed._make, csv.reader(open("feeds.csv", "rb"))):
      d = feedparser.parse(feed.url)
      for item in d.entries:
          db.save(dict(item))
  
  Traceback (most recent call last):
    File "./feedchomper.py", line 32, in &lt;module&gt;
      db.save(dict(item))
    File "/home/dealpref/lib/python2.7/couchdb/client.py", line 407, in save
  _, _, data = func(body=doc, **options)
    File "/home/dealpref/lib/python2.7/couchdb/http.py", line 399, in post_json
  status, headers, data = self.post(*a, **k)
    File "/home/dealpref/lib/python2.7/couchdb/http.py", line 381, in post
  **params)
    File "/home/dealpref/lib/python2.7/couchdb/http.py", line 419, in _request
  credentials=self.credentials)
    File "/home/dealpref/lib/python2.7/couchdb/http.py", line 239, in request
      resp = _try_request_with_retries(iter(self.retry_delays))
    File "/home/dealpref/lib/python2.7/couchdb/http.py", line 196, in _try_request_with_retries
      return _try_request()
    File "/home/dealpref/lib/python2.7/couchdb/http.py", line 222, in _try_request
      chunk = body.read(CHUNK_SIZE)
  AttributeError: 'dict' object has no attribute 'read'
  </code></pre>
  
  <p>w-what? That doesn't make sense, because the following works just fine and the type is still <code>dict</code>:</p>
  
  <pre><code>some_dict = dict({'foo': 'bar'})
  print(type(some_dict))
  db.save(some_dict)
  </code></pre>
  
  <p>What am I missing here?</p>