Permalink
Browse files

Fix for OSM importer not correctly handling end of file

  • Loading branch information...
1 parent 7862756 commit b37d261e9ae0438194a2129817315bc34da31344 @cnorthwood cnorthwood committed Jul 28, 2011
Showing with 4 additions and 1 deletion.
  1. +2 −0 molly/apps/places/providers/osm.py
  2. +2 −1 molly/batch_processing/models.py
@@ -53,6 +53,7 @@ def startDocument(self):
self.node_locations = {}
def startElement(self, name, attrs):
+
if name == 'node':
lon, lat = float(attrs['lon']), float(attrs['lat'])
@@ -299,6 +300,7 @@ def import_data(self, metadata, output):
while buffer:
parser.feed(bunzip.decompress(buffer))
buffer = osm.read(8192)
+ parser.close()
for lang_code, lang_name in settings.LANGUAGES:
with override(lang_code):
@@ -91,4 +91,5 @@ def run(self, tee_to_stdout=False):
self.save()
def __unicode__(self):
- return self.title
+ return self.title
+

0 comments on commit b37d261

Please sign in to comment.