Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Extra content at the end of the document #60

Open
kercos opened this issue Aug 15, 2016 · 1 comment
Open

Fatal error: Extra content at the end of the document #60

kercos opened this issue Aug 15, 2016 · 1 comment
Labels

Comments

@kercos
Copy link

kercos commented Aug 15, 2016

HI,

I'm having some problem with running osmapi on google application engine (GAE). On my local machine the following function works perfectly.

def insertNewLocation(lat, lon):
    MyApi = OsmApi(username=key.OSM_ID, password=key.OSM_PW)
    MyApi.ChangesetCreate({u"comment": u"node creation test"})
    MyApi.NodeCreate({u"lat": lat, u"lon": lon, u"tag": {u"amenity": u"drinking_water"}})
    MyApi.ChangesetClose()

However, on GAE I get the following exception:

Detected Exception: Request failed: 400 - Bad Request - Cannot parse valid node from xml string 
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="osmapi/0.6.2">
  <changeset visible="true">
    <tag k="comment" v="node creation from SearchAroundBot"/>
    <tag k="createdby" v="osmapi/0.6.2"/>
  </changeset>
</osm>
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="osmapi/0.6.2">
  <node lat="51.830871" lon="5.853506" visible="true" changeset="41475419">
    <tag k="note" v="Created by Telegram SearchAroundBot"/>
    <tag k="amenity" v="drinkingwater"/>
    <tag k="bot" v="yes"/>
  </node>
</osm>
. Fatal error: Extra content at the end of the document at :9.

It looks like an underscore disappeared in the xml on the tag value 'drinking_water', but the problem persists with other values not containing underscores (e.g., 'recycling').

Have you encounter this before?

Perhaps one way to debug this problem is to print the 'correct' xml that is sent to the server from my own machine? Is there any easy way to do that?

Thanks

@metaodi metaodi added the bug label Dec 7, 2016
@AchilleasMich
Copy link

AchilleasMich commented Apr 23, 2017

Could the problem be the new line after </osm> tag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants