Page MenuHomePhabricator

testPatrol: protectednamespace-interface
Closed, InvalidPublic

Description

https://travis-ci.org/jayvdb/pywikibot-core/jobs/61779706#L872

======================================================================
ERROR: Test the site.patrol() method.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jayvdb/pywikibot-core/tests/site_tests.py", line 1369, in testPatrol
    result = list(mysite.patrol(rcid=rc['rcid']))
  File "/home/travis/build/jayvdb/pywikibot-core/pywikibot/site.py", line 4652, in patrol
    result = req.submit()
  File "/home/travis/build/jayvdb/pywikibot-core/pywikibot/data/api.py", line 1734, in submit
    raise APIError(**result['error'])
nose.proxy.APIError: protectednamespace-interface: You're not allowed to edit interface messages
-------------------- >> begin captured stdout << ---------------------
 20.050s 
--------------------- >> end captured stdout << ----------------------
-------------------- >> begin captured logging << --------------------
pywiki: VERBOSE: Found 2 wikidata:test processes running, including this one.
pywiki: VERBOSE: START /home/travis/build/jayvdb/pywikibot-core/tests/site_tests.py:SiteUserTestCase2.testPatrol
pywiki: INFO: Sleeping for 19.7 seconds, 2015-05-08 16:50:54
pywiki: VERBOSE: API Error: query=
{'action': ['patrol'],
 'assert': ['user'],
 'format': ['json'],
 'maxlag': ['5'],
 'rcid': [12117],
 'token': ['83c2963990b7d864552e16942aa4d8ed554ce96e+\\']}
pywiki: VERBOSE:            response=
{'error': {'info': "You're not allowed to edit interface messages", 'code': 'protectednamespace-interface', 'help': 'See https://test.wikidata.org/w/api.php for API usage'}, 'servedby': 'mw1017'}
pywiki: VERBOSE: END /home/travis/build/jayvdb/pywikibot-core/tests/site_tests.py:SiteUserTestCase2.testPatrol NOT OK: ERROR
--------------------- >> end captured logging << ---------------------

Event Timeline

jayvdb raised the priority of this task from to Needs Triage.
jayvdb updated the task description. (Show Details)
jayvdb added projects: Pywikibot, Pywikibot-tests.
jayvdb subscribed.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptMay 8 2015, 10:04 PM

The API does not allow patrolling edits in MediaWiki namespace and returns protectednamespace-interface error code.

There is no need the patrol edits in this namespace because only admins can edit it and they have autopatroll access.

We can simply skip the test in this situation, or limit the RC results to exclude mediawiki namespace.

We could also as ask MediaWiki-Action-API guys to silently handle this error or improve the wording of the message. (You're not allowed to edit interface messages it says, but we are not really trying to edit anything here, just patrolling. Also it's worth mentioning that I have faced this error on a wiki where I have interface admin rights.)

I think the error message has changed.

{'code': 'protectednamespace-interface', 'info': 'This page provides interface text for the software on this wiki, and is protected to prevent abuse. To add or change translations for all wikis, please use [https://translatewiki.net/ translatewiki.net], the MediaWiki localisation project.', '*': 'See https://fa.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for notice of API deprecations and breaking changes.'}

I could not reproduce the error.
For the record, I made sure that the tested edit is on an interface page. It's possible that the internals of MW or our API handling has changed since 2015.
Closing as invalid.