Page MenuHomePhabricator

template.py does not show when a page is saved
Open, MediumPublic

Description

When saving a page with template the saving comment is missing:

C:\pwb\GIT\core>pwb.py template Persondata -remove -page:"%D8%A2%D8%AF%D8%A7%D9%85_%D9%87%D8%A7%D9%85%D9%84" -lang:ar
WARNING: Bot.site was not set before being retrieved.
WARNING: Using the default site: wikipedia:ar
Retrieving 1 pages from wikipedia:ar.
WARNING: Bot.site was not set before being retrieved.
WARNING: Using the default site: wikipedia:ar


>>> آدام هامل <<<
@@ -17,5 +17 @@
+
- {{Persondata
- |NAME=آدام هامل
- |ALTERNATIVE NAMES=
- |SHORT DESCRIPTION=لاعب كرة قدم إنجليزي
- |DATE OF BIRTH={{تاريخ الميلاد|1988|1|25|df=y}}

Do you want to accept these changes? ([y]es, [N]o, [e]dit, open in [b]rowser, [a
]ll, [q]uit): y
Sleeping for 4.9 seconds, 2016-04-08 09:26:40

I expect sth like
Page [[آدام هامل]] saved.
at the end.

Also site setting should be improved to avoid this warnings.

Event Timeline

Xqt created this task.Apr 8 2016, 9:04 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptApr 8 2016, 9:04 AM
Xqt triaged this task as Medium priority.Apr 8 2016, 9:05 AM
Xqt added a comment.Apr 8 2016, 9:11 AM

A changed behaviour was introduced by https://gerrit.wikimedia.org/r/#/c/248680/. I suppose to let quiet=False by default.

Mpaa added a subscriber: Mpaa.EditedApr 8 2016, 8:45 PM

I think the problem appears when throttling is > 0.
The queue in replace.py is empty and the bot.run() exits before the save() callback (which would fill the queue of the pending pages) is triggered.
And when answer is yes, as async=True.

Also, the behavior of stopme was changed: https://gerrit.wikimedia.org/r/#/c/276428/, it does not clear async_manager by default.

Change 282433 had a related patch set uploaded (by Mpaa):
Allow stopme() to clear async_manager

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

jayvdb added a subscriber: jayvdb.EditedApr 10 2016, 10:33 PM

If the behaviour of stopme was changed, is it a regression, or was it an intentional breaking change?

If intentional, we need to justify the breaking change. Did the changed behaviour make it more similar to compat?
If the breaking change is appropriate, we need to Pywikibot-Announce an explanation to our userbase that they need to update their code if they used the async thread ??

Xqt updated the task description. (Show Details)Apr 11 2016, 6:48 AM
Xqt added a comment.Apr 11 2016, 7:34 AM

The intention of stopme() is to drop the bot PID out of the throttle list. Unfortunately it didn't work when the script is not terminated after that. Therefore the _flush was introduced to flush async_manager at exit time only. The implementation in replace.py looks like a dirty hack. I guess we can

  • keep printing inside save(). I do not understand why this should not be there.
  • put the print functionality into the callback method
  • add a print function to the queue and fix the calculation of the remaining pages and putting time.
Xqt added a comment.EditedApr 11 2016, 2:49 PM

See also T74942, T73646

Change 282433 abandoned by Mpaa:
ReplaceBot: use pywikibot._flush() to clear async_manager

Reason:
Xqt will take care of it without too many hacks ...

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

Change 282818 had a related patch set uploaded (by Xqt):
[bugfix] Port cache_output from compat

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

Dvorapa reopened this task as Open.Sep 30 2018, 1:55 PM
Dvorapa added a subscriber: Dvorapa.

Does not seems to be a dupe

Meno25 removed a subscriber: Meno25.Nov 23 2018, 7:53 AM
Xqt moved this task from Backlog to Needs Review on the Pywikibot board.Feb 3 2019, 11:23 AM
Xqt claimed this task.Feb 7 2019, 4:26 PM
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptApr 10 2020, 9:04 AM