colonelpanic8/okcupyd

some properties on detail have gone missing

Opened this issue · 2 comments

This seems to have happened only recently, perhaps in the past month or two, presumably because of changes in what OKCupid returns in response to requests. The problem is that for some profiles p, attempts to call for example p.details.religion will fail with an error about p.details having no such field. I've seen this also with the education, sign, bodytype, and children fields (and perhaps others, I didn't attempt an exhaustive search). I don't have an stack trace handy to cut and paste (I edited the code to work around this issue). But the bottom of the stack trace was around line 74 on details.py:

return self.presenter(details.id_to_display_name_value[self.id_name])

self.id_name would resolve to (for example) "religion", but details.id_to_display_name_value would, contrary to design, fail to contain that key.

Hmmm. Seems like this implementation might need to be made a bit more robust so we can detect these types of issues and provide less cryptic error messages.

Any example profiles would be extremely helpful.

I agree that this needs a robust fix. On my machine, I just changed to return self.presenter(details.id_to_display_name_value.get(self.id_name, u'\u2014')) as a work-around. The default lambda for self.presenter will then be a constant function that returns None. But that's just a work-around. I'll email you privately about examples.