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

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.