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., ./ runserver or .), you'll get a traceback that culminates in:

File "/usr/local/google_appengine/google/net/proto/", line 455, in getDouble
  return struct.unpack("d", a)[0]
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/", 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.