Vin Diesel
New Member
I am trying to fetch and parse an XML file into a databse. The XML is compressed in GZIP. The GZIP file is ~8MB. When I run the code locally the memory on pythonw.exe builds up to level where the entire system (Windows 7) stops responding, and when I run it online it exceeds the memory limit on Google App Engine. Not sure if the file is too big or if I am doing something wrong. Any help would be very much appreciated!\[code\]from google.appengine.ext import webappfrom google.appengine.api.urlfetch import fetchfrom xml.dom.minidom import parseStringimport gzipimport base64import StringIOclass ParseCatalog(webapp.RequestHandler):user = xxxpassword = yyycatalog = fetch('url', headers={"Authorization": "Basic %s" % base64.b64encode(user + ':' + password)}, deadline=600)xmlstring = StringIO.StringIO(catalog.content)gz = gzip.GzipFile(fileobj=xmlstring)gzcontent = gz.read()contentxml = parseString(gzcontent)items = contentxml.getElementsByTagName("Product")for item in items: item = DatabaseEntry() item.name = str(coupon.getElementsByTagName("Manufacturer")[0].firstChild.data) item.put()\[/code\]