Page MenuHomePhabricator

New pages are not being created by pagefromfile.py
Closed, ResolvedPublic

Description

The pagefromfile.py Pywikibot script as installed on Tool Labs in /shared/pywikipedia/core/scripts/pagefromfile.py, possibly following the recent 673741f9832e commit, does not create a wiki page when it does not exist already. Instead, "No changes were needed on <page title>" is erroneously reported. This might be a general bug in Pywikibot, not linked just to Tool Labs where I experience this issue.

Steps to reproduce:

In a tool account, create a file called "test.txt" with the folowing content:

{{-start-}}
'''Wikipedista:Blahma/Pywikibot'''
Pywikibot pagefromfile test content
{{-stop-}}

The page Wikipedista:Blahma/Pywikibot does not exist on cs.wikipedia.org yet.
Then log in with Pywikibot and run the following command:

python /shared/pywikipedia/core/scripts/pagefromfile.py -lang:cs -file:test.txt

Result: "No changes were needed on [[Wikipedista:Blahma/Pywikibot]]" is shown
Expected: [[Wikipedista:Blahma/Pywikibot]] gets created with content from test.txt

Workaround: If I create the target page manually, e.g. by placing some dummy text and saving, and then run the same pagefromfile.py, the target page's content gets updated as expected.

Details

Related Gerrit Patches:

Event Timeline

Blahma created this task.Oct 9 2016, 11:07 PM
Restricted Application added a project: Cloud-Services. · View Herald TranscriptOct 9 2016, 11:07 PM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript
Xqt claimed this task.Oct 10 2016, 2:11 PM
Xqt triaged this task as Normal priority.

Change 315095 had a related patch set uploaded (by Xqt):
[bugfix] reset the page.text content

https://gerrit.wikimedia.org/r/315095

I applied the patch and it worked for me.

Thank you very much for acting up on my report so swiftly!
The patch is apparently not yet live on Tool Labs, but hopefully will soon be.

Xqt closed this task as Resolved.Oct 21 2016, 10:31 PM

Change 315095 merged by jenkins-bot:
[bugfix] reset the page.text content

https://gerrit.wikimedia.org/r/315095