json - Weird HTTP data accumulation on App Engine with Python and CouchDB -


i'm trying make relatively simple app engine app fetch pages on daily basis , post data couchdb server. i've got following code in app engine app (with couchdb-python library):

    # post result couchdb     price_data = {       'source': 'blah',       'date': str(result.headers['date'])     }     db.save(price_data)     db.put_attachment(price_data, file_one, 'prices_one.txt')     db.put_attachment(price_data, file_two, 'prices_two.txt') 

file_one , file_two results earlier urlfetch requests.

now works fine except first attachment gets posted price_data json ({ 'source': 'blah', 'date': 'date here'}) @ beginning of prices_one text file, , second attachment gets prefixed both price_data json whole prices_one text file, followed actual prices_two.txt file.
i'm sure if tried add third attachment, post accumulated data one.
if go on couchdb @ file in db, it's full file, { 'source': 'blah', 'date': 'date here'} @ beginning.

any ideas causing app engine keep resending previous data each new http post? also, should note doing same thing before started using couchdb-python library, seems app engine related don't understand.

during investigation, try use raw http library instead of couchdb library. suggest native app engine library (urlfetch or perhaps urllib2). couchdb api simple, not have difficulty.

is there difference in result?


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -