Alex S.H. Lin has submitted this change and it was merged.
Change subject: (bug 58505) pass 'textmissing' error and raise serverError ......................................................................
(bug 58505) pass 'textmissing' error and raise serverError
Sometimes the text is missing and we get a "textmissing" entry via api. Now we ignore that bug and we raise a serverError in next step because textareaFound remains false.
Change-Id: I63bfea933a00243c7b38d8c71f5733b2b6d092af --- M wikipedia.py 1 file changed, 5 insertions(+), 1 deletion(-)
Approvals: Alex S.H. Lin: Verified; Looks good to me, approved jenkins-bot: Verified
diff --git a/wikipedia.py b/wikipedia.py index 7c6feec..18c2b2c 100644 --- a/wikipedia.py +++ b/wikipedia.py @@ -852,7 +852,11 @@ raise BadTitle('BadTitle: %s' % self) elif 'revisions' in pageInfo: # valid Title lastRev = pageInfo['revisions'][0] - if isinstance(lastRev['*'], basestring): + if 'textmissing' in lastRev: + # Maybe we could use a new error exception. + # Now we just pass and got a server error + pass + elif isinstance(lastRev['*'], basestring): textareaFound = True # I got page date with 'revisions' in pageInfo but # lastRev['*'] = False instead of the content. The Page itself was