From 86ace947f21c87b082abb91b33145eaa5a66da80 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Jan 28 2016 09:05:23 +0000 Subject: report_validation_results: properly handle not-found pages any time we couldn't instantiate a Page at all from the info in a ResTup (as opposed to instantiating a Page which doesn't exist in the wiki, which is a slightly different case) we'd wind up exploding further down because we'd try to iterate a None - we're setting a value in pagedict to None but later we try to do `for (page, resdict) in pagedict.values()`, which isn't going to end well. So, instead when we don't find a matching page, set the value to (None, None) and handle that appropriately in the one other place we check for a none-y value. --- diff --git a/wikitcms/wiki.py b/wikitcms/wiki.py index 0ed99f0..11e74ba 100644 --- a/wikitcms/wiki.py +++ b/wikitcms/wiki.py @@ -538,13 +538,13 @@ class Wiki(mwclient.Site): except ValueError: # This means we couldn't find a page from the info # provided; set the pagedict entry for this key to - # None to cache that information, add this result - # to the 'insufficients' list, and move on to the - # next. - pagedict[key] = None + # (None, None) to cache that information, add this + # result to the 'insufficients' list, and move on + # to the next. + pagedict[key] = (None, None) insufficients.append(resitem) continue - elif not pagedict[key]: + elif pagedict[key] == (None, None): # This is when we've already tried to find a page from # the same (testtype, release, milestone, compose) and # come up empty, so append the restup to the insuffs