[QA] Error coming from mw-api-siteinfo.py

Antoine Musso hashar+wmf at free.fr
Thu Sep 18 19:27:56 UTC 2014


Le 12/09/2014 13:49, Željko Filipin a écrit :
> On Wed, Sep 10, 2014 at 8:53 PM, S Page
> <spage at wikimedia.org
> <mailto:spage at wikimedia.org>> wrote:
> 
>     To avoid wasting time in misdiagnosis, instead of mw-api-siteinfo.py
>     reporting JSON parsing errors from
> 
>        siteinfo = json.loads(response.content)
> 
>     it should earlier fail with "ERROR 404 response
>     fromhttp://en.wikipedia.beta.wmflabs.org/w/api.php
>     <http://en.wikipedia.beta.wmflabs.org/w/api.php> , aggghhh!"
> 
> 
> This is tracked in bug 70695[1].

Solved by S. The python script will now raise an exception whenever
there is a dubious status code thanks to a one line fix:

+ response.raise_for_status()


-- 
Antoine "hashar" Musso




More information about the QA mailing list