simplegeo / python-simplegeo

A client interface for SimpleGeo's API.
http://simplegeo.com
104 stars 18 forks source link

Exception in Storage #29

Open ieure opened 12 years ago

ieure commented 12 years ago

From this support thread: https://groups.google.com/forum/#!topic/simplegeo/iygFmqrRGK4

Hi,

I'm trying to integrate the python sdk into our app.

The test record looks like this:

{"geometry": {"type": "Point", "coordinates": ["0", "0"]}, "properties": {"layer": "com.arctouch.simplegeo.whereabouts", "name": "Eric Chamberlain", "facebook_id": "786359552"}, "type": "Feature", "id": "a9e0bfcf-e09c-11e0-beb3-09313b4930f6", "created": 1316204476}

And it generates the following exception:

Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/_webapp25.py", line 701, in call handler.get(*groups) File "/Users/eric/ArcTouch/Projects/WAWEB/trunk/Whereabouts.GoogleAppEngine/main.py", line 88, in get self.post() File "/Users/eric/ArcTouch/Projects/WAWEB/trunk/Whereabouts.GoogleAppEngine/main.py", line 130, in post result = client.storage.add_record(r) File "/Users/eric/ArcTouch/Projects/WAWEB/trunk/Whereabouts.GoogleAppEngine/simplegeo/storage/init.py", line 31, in add_record self._request(endpoint, "PUT", record.to_json()) File "/Users/eric/ArcTouch/Projects/WAWEB/trunk/Whereabouts.GoogleAppEngine/simplegeo/init.py", line 150, in _request if self.headers['status'][0] not in ('2', '3'): TypeError: 'int' object is unsubscriptable

Any idea why and how to prevent the exception?

echamberlain commented 12 years ago

Duplicate of issue #24.

echamberlain commented 12 years ago

Issue fixed in the pull request associated with issue #30.