Open dubiousjim opened 9 years ago
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.
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 examplep.details.religion
will fail with an error aboutp.details
having no such field. I've seen this also with theeducation
,sign
,bodytype
, andchildren
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 ondetails.py
:self.id_name
would resolve to (for example)"religion"
, butdetails.id_to_display_name_value
would, contrary to design, fail to contain that key.