Page MenuHomePhabricator

replace.py incorrectly counts number of changes
Closed, DuplicatePublic

Description

pwb.py replace -regex -page:Foo 1 2

Retrieving 1 pages from wikipedia:cs.


>>> Foo <<<
@@ -2 +2 @@
- ;1a
+ ;2a

Do you want to accept these changes? ([y]es, [N]o, [e]dit, open in [b]rowser, [a]ll, [q]uit): y

0 pages changed.

Why 0 when 1 was changed?

Event Timeline

JAnD created this task.Mar 15 2016, 8:17 PM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMar 15 2016, 8:17 PM
Mpaa added a subscriber: Mpaa.EditedMar 16 2016, 7:48 PM

user@pc:~/python/core$ python pwb.py replace -regex -page:User:Mpaa/x 3 2
The summary message for the command line replacements will be something like: Bot: Automated text replacement (-3 +2)
Press Enter to use this automatic message, or enter a description of the
changes your bot will make: test
Retrieving 1 pages from wikisource:en.

>>> User:Mpaa/x <<<
@@ -1 +1 @@
- test3——
+ test2——

Do you want to accept these changes? ([y]es, [N]o, [e]dit, open in [b]rowser, [a]ll, [q]uit): y
Sleeping for 3.1 seconds, 2016-03-16 20:46:53

1 pages changed.