My IP geo location script cache requests coming from the same ip range (subnet mask 255.255.255.0) named as class-c ip address (last number cutted). This value is the reference for look up in memcache. But yesterday I got an exception while calculating the ip from the request object.
def get(self):
ipStr = self.request.remote_addr
classC = reduce(lambda a, b: int(a)*256+int(b), ipStr.split(".")[:3])
logging.info("request from classC ip address:: %d" % classC)
...
This request crashed (TypeError: int argument required) by using an IPv6 address (found in the google app engine logs):Read more