DeaconDesperado / python-geohash

Automatically exported from code.google.com/p/python-geohash
0 stars 0 forks source link

encode_uint64 / decode_uint64 cause unpredicted behavior #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
when encoding and then decoding a uint64 geohash, I'm seeing very strange 
behavoid:

What steps will reproduce the problem?
see example:
>>> x = geohash.encode_uint64(35,35)
>>> geohash.decode_uint64(x)
(35.000000009313219, 35.000000009313219)
>>> geohash.decode_uint64(x)
SystemError: ../Objects/longobject.c:992: bad argument to internal function
>>> geohash.decode_uint64(x)
(35.000000009313219, 35.000000009313219)
>>> geohash.decode_uint64(x)
SystemError: ../Objects/longobject.c:992: bad argument to internal function

and so on.....
this happens also if i just print x right after the decoding.
needless to say this makes the module very unpredictable...

This happens on ubuntu 10.10 64 bit, python 2.6, geohash freshly installed from 
pypi (0.8.1)

Original issue reported on code.google.com by dvir...@gmail.com on 27 Mar 2011 at 5:00

GoogleCodeExporter commented 9 years ago
Another note - this only happens with the binary module. pure python works fine.

Original comment by dvir...@gmail.com on 27 Mar 2011 at 9:59

GoogleCodeExporter commented 9 years ago
Humm.. strange. I don't have 64 bit ubuntu right now, so it may take some time 
to look into what's happening.

Original comment by Hiroaki.Kawai@gmail.com on 29 Mar 2011 at 12:54

GoogleCodeExporter commented 9 years ago
fixed at r229, targetd to 0.8.2.

Original comment by Hiroaki.Kawai@gmail.com on 30 Mar 2011 at 5:44

GoogleCodeExporter commented 9 years ago
Cool!
Is it safe to use trunk in production in its current state? Or should I patch 
0.8.1?

Original comment by dvir...@gmail.com on 30 Mar 2011 at 6:11

GoogleCodeExporter commented 9 years ago
I already packaged 0.8.2, which is the same with trunk right now, there's no 
difference.

Original comment by Hiroaki.Kawai@gmail.com on 30 Mar 2011 at 7:17

GoogleCodeExporter commented 9 years ago
thanks for the quick response.
btw, I used it for this little project:
https://github.com/doat/geodis
Currently I switched to using geohasher because of that bug, but I'll switch 
back to python-geohash soon :)

Original comment by dvir...@gmail.com on 30 Mar 2011 at 4:06