object.location
will never give the "correct" position for a object that has a constraint on it (or a parented object).
That comes from the way parentingparenting and constraints mess with the global coordinates (their effect gets calculated after the object.location
).
To get the world position of the a child object (or an object governed by a constraint) you should use object.matrix_world.translation
.
matrix_world returns a matrix for the object's transformations in world space. The .translation
part will convert the matrix to a location vector (just like .location
).
The blender wiki has a good read for further explanation about the coordinates for parented objects (same principals for constraints).