#235 ERROR: Cannot find usable urls here in certain bugs
Closed: Fixed None Opened 9 years ago by orion.

fedora-review -b 613001 cannot find URLs. This is because in url_bug.py:

{{{
hrefs = map(lambda l: l['href'], links)
}}}

will generate a !KeyError if a link does not have an href attribute. Two possible solutions are:

{{{
hrefs = map(lambda l: l['href'] if l.get('href') else '', links)
}}}
or
{{{
hrefs = [l.get('href') for l in links if l.get('href')]
}}}

We can't just use l.get('href') because it will return None if there is no 'href' attribute, and that will generate an exception when passed to encode() later.


Login to comment on this ticket.

Metadata