emacsen / changemonger

An OpenStreetMap change analyzer
GNU Affero General Public License v3.0
15 stars 4 forks source link

Some XML breaks ElementTree #8

Closed emacsen closed 12 years ago

emacsen commented 12 years ago

Changeset 12742250 causes a crash in elementree:

Traceback (most recent call last): File "/home/serge/.virtualenvs/changemonger/lib/python2.7/site-packages/flask/app.py", line 1701, in call return self.wsgi_app(environ, start_response) File "/home/serge/.virtualenvs/changemonger/lib/python2.7/site-packages/flask/app.py", line 1689, in wsgi_app response = self.make_response(self.handle_exception(e)) File "/home/serge/.virtualenvs/changemonger/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app response = self.full_dispatch_request() File "/home/serge/.virtualenvs/changemonger/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/serge/.virtualenvs/changemonger/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request rv = self.dispatch_request() File "/home/serge/.virtualenvs/changemonger/lib/python2.7/site-packages/flask/app.py", line 1344, in dispatch_request return self.view_functionsrule.endpoint File "/home/serge/changemonger/app.py", line 89, in display_changeset cset = helpers.get_changeset_or_404(id) File "/home/serge/changemonger/helpers.py", line 38, in get_changeset_or_404 return changemonger.changeset(id) File "/home/serge/changemonger/changemonger.py", line 65, in changeset xml = et.XML(data) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1301, in XML parser.feed(text) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1641, in feed self._parser.Parse(data, 0) UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 472: ordinal not in range(128)

emacsen commented 12 years ago

Awesome! Thanks! Closing this out.