In 2008, over one thousand people experienced the world’s first virtual web conference. Together, we created a new type of conference that is environmentally-friendly, affordable, and interactive.

In 2009, we are going to take it one step further.


Saving a Float or GeoPt in Google App Engine? You need this patch.

This one had me scratching my head and wondering what I'd managed to corrupt in my setup today:

After you save a float (or, in my case, a GeoPt instance) to the datastore, the next time you start the server (e.g., ./manage.py runserver or dev_appserver.py .), you'll get a traceback that culminates in:

File "/usr/local/google_appengine/google/net/proto/ProtocolBuffer.py", line 455, in getDouble
  return struct.unpack("d", a)[0]
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/struct.py", line 87, in unpack
  return o.unpack(s)

This ticket, by blfgomes, explains what the problem is and contains a patch that fixes it. In a nutshell, the method struct.unpack expects a string but is getting an array.

Post Metadata

Date
June 9th, 2008

Author
Aral

Category

Tags


Leave a Reply



Bad Behavior has blocked 0 access attempts in the last 7 days.