Page MenuHomePhabricator

Unable to change Proofread status via API (pywikibot)
Closed, InvalidPublic

Description

Using:
python scripts/pagefromfile.py -notitle -force -summary:'Bot request: fill List' -pt:0 -showdiff -file:'WS.txt'
I was unable to change proofread status of the page, regardless if also user is changed or not.

See two pages below.

Please note that I instrumented the script to check if the bot was logged on and whit which user.
For both cases, pywikibot reports: Logged in? True, Logged in as: MpaaBot

I have done it several times in the past. See also T134757.

Reading 'WS.txt'...


>>> Page:United States Statutes at Large Volume 33 Part 1.djvu/33 <<<
Page Page:United States Statutes at Large Volume 33 Part 1.djvu/33 already exists, ***overwriting!
@@ -1 +1 @@
- <noinclude><pagequality level="1" user="MpaaBot" />{{rh|xxxiv|LIST OF PRIVATE ACTS AND RESOLUTION.|}}
+ <noinclude><pagequality level="3" user="MpaaBot" />{{rh|xxxiv|LIST OF PRIVATE ACTS AND RESOLUTION.|}}

Edit summary: Bot request: fill List *** existing text overwritten ***
Do you want to accept these changes? ([y]es, [N]o, [a]ll, [q]uit): y
WARNING: API error proofreadpage_notallowedtext: You are not allowed to change the proofreading status of this page.
ERROR: Skipping Page:United States Statutes at Large Volume 33 Part 1.djvu/33 because of a save related error: Edit to page [[Page:United States Statutes at Large Volume 33 Part 1.djvu/33]] failed:
proofreadpage_notallowedtext: You are not allowed to change the proofreading status of this page. [help:See https://en.wikisource.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.]
Logged in? True, Logged in as: MpaaBot


>>> Page:United States Statutes at Large Volume 33 Part 1.djvu/34 <<<
Page Page:United States Statutes at Large Volume 33 Part 1.djvu/34 already exists, ***overwriting!
@@ -1 +1 @@
- <noinclude><pagequality level="1" user="TarmstroBot" />{{rh||LIST OF PRIVATE ACTS AND RESOLUTION.|xxxv}}
+ <noinclude><pagequality level="3" user="MpaaBot" />{{rh||LIST OF PRIVATE ACTS AND RESOLUTION.|xxxv}}

Edit summary: Bot request: fill List *** existing text overwritten ***
Do you want to accept these changes? ([y]es, [N]o, [a]ll, [q]uit): y
WARNING: API error proofreadpage_notallowedtext: You are not allowed to change the proofreading status of this page.
ERROR: Skipping Page:United States Statutes at Large Volume 33 Part 1.djvu/34 because of a save related error: Edit to page [[Page:United States Statutes at Large Volume 33 Part 1.djvu/34]] failed:
proofreadpage_notallowedtext: You are not allowed to change the proofreading status of this page. [help:See https://en.wikisource.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.]
Logged in? True, Logged in as: MpaaBot

Event Timeline

Mpaa created this task.Aug 15 2017, 8:09 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 15 2017, 8:09 PM
Mpaa added a comment.Oct 15 2017, 3:47 PM

@Tpt, have you had time to look into this? Thanks!

Restricted Application added a subscriber: pywikibot-bugs-list. · View Herald TranscriptJun 19 2018, 9:36 AM
Mpaa added a comment.Aug 12 2018, 8:29 PM

@Tpt, could you please look into this? Thanks.

Mpaa added a comment.EditedAug 12 2018, 9:55 PM

I found out that MpaaBot has no 'pagequality' rights.
Mpaa works as expected instead.
I think this is not an issue wth ProofreadPage but with permissions of users on enwikisource.

Mpaa closed this task as Invalid.Aug 13 2018, 8:38 AM
Mpaa added a comment.Aug 14 2018, 9:54 AM

Just for the records, think the issue is with an account be logged in via OAuth or not.
Also "Mpaa" behaves differently depending on how I am logged in.

Actually I tested it with the bot account and the sysop account, both resulting in the You are not allowed to change the proofreading status of this page. error when creating a page in ns:Page.
Thus it seems that it is not possible to create or modify ns:Page using pywikibot?

command line:

pwb.py transferbot -family:wikisource -lang:it -tolang:nap -overwrite -ql:4 -prefixindex:'Pagina:Canzone_e_Ariette_nove.djvu'

output:

  Page transfer configuration
  ---------------------------
  Source: APISite("it", "wikisource")
  Target: APISite("nap", "wikisource")

  Pages to transfer: -prefixindex:Pagina:Canzone_e_Ariette_nove.djvu -ql:4

  Prefix for transferred pages:

Moving [[Pagina:Canzone e Ariette nove.djvu/1]] to [[nap:Paggena:Canzone e Ariette nove.djvu/1]]...
Sleeping for 9.2 seconds, 2020-01-15 13:26:38

WARNING: API error proofreadpage_notallowedtext: You are not allowed to change the proofreading status of this page.
Traceback (most recent call last):
File "/srv/paws/pwb/pywikibot/page.py", line 107, in handle
  func(self, *args, **kwargs)
File "/srv/paws/pwb/pywikibot/page.py", line 1293, in _save
  watch=watch, bot=botflag, **kwargs)
File "/srv/paws/pwb/pywikibot/site.py", line 1320, in callee
  return fn(self, *args, **kwargs)
File "/srv/paws/pwb/pywikibot/site.py", line 5267, in editpage
  result = req.submit()
File "/srv/paws/pwb/pywikibot/data/api.py", line 2079, in submit
  raise APIError(**result['error'])
pywikibot.data.api.APIError: proofreadpage_notallowedtext: You are not allowed to change the proofreading status of this page. [help:See https://nap.wikisource.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.]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/srv/paws/pwb/pwb.py", line 250, in <module>
  if not main():
File "/srv/paws/pwb/pwb.py", line 243, in main
  run_python_file(filename, [filename] + args, argvu, file_package)
File "/srv/paws/pwb/pwb.py", line 95, in run_python_file
  main_mod.__dict__)
File "/srv/paws/pwb/scripts/transferbot.py", line 179, in <module>
  main()
File "/srv/paws/pwb/scripts/transferbot.py", line 171, in main
  targetpage.put(text, summary=summary)
File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1738, in wrapper
  return obj(*__args, **__kw)
File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1738, in wrapper
  return obj(*__args, **__kw)
File "/srv/paws/pwb/pywikibot/page.py", line 1360, in put
  **kwargs)
File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1738, in wrapper
  return obj(*__args, **__kw)
File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1738, in wrapper
  return obj(*__args, **__kw)
File "/srv/paws/pwb/pywikibot/page.py", line 1282, in save
  cc=apply_cosmetic_changes, quiet=quiet, **kwargs)
File "/srv/paws/pwb/pywikibot/page.py", line 128, in wrapper
  handle(func, self, *args, **kwargs)
File "/srv/paws/pwb/pywikibot/page.py", line 120, in handle
  raise pywikibot.OtherPageSaveError(self, err)
pywikibot.exceptions.OtherPageSaveError: Edit to page [[nap:Paggena:Canzone e Ariette nove.djvu/1]] failed:
proofreadpage_notallowedtext: You are not allowed to change the proofreading status of this page. [help:See https://nap.wikisource.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.]
CRITICAL: Exiting due to uncaught exception <class 'pywikibot.exceptions.OtherPageSaveError'>
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptWed, Jan 15, 1:34 PM
Mpaa added a comment.Wed, Jan 15, 11:26 PM

I am not sure but in this case you are creating a new page in a different wiki, using an existing page with ql=4.
Probably it is trying to set ql=4 also in the new page, violating the rule about change of status Not Proofread->Proofread, Validated.
@Tpt, any opinion?
Maybe pywikibot could be smarter here and check?

Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptWed, Jan 15, 11:26 PM
Tpt added a comment.Thu, Jan 16, 10:00 AM

Indeed, the extension does not allow to create pages directly with the "validated" level.

@Mpaa Well, the same happens without the option ql=4.
@Tpt there is any workaround?

Mpaa added a comment.Thu, Jan 16, 10:20 PM

@Mpaa Well, the same happens without the option ql=4.

ql=4 is not the matter (it is just a filter on the pages the script should use), the 'Validated' code is inside the wikitext of the page.
Or you mean that there are other pages with lower quality level where you have the same issue?
If so, could you post it?