Page MenuHomePhabricator

Edits saved with botflag don't show up as bot edits on wiki, even though the bot has the right and "botflag" was set to True
Closed, InvalidPublic

Description

When saving an edit using Page.save(botflag=True), the edit produced is not marked as bot edit on the wiki. For example:

import pywikibot

def main():
    pywikibot.Site().login()
    page = pywikibot.Page(pywikibot.Site(), "User:Dreamy Jazz Bot/Links added to portals which need checking")
    page.text += "test"
    page.save(botflag=True)

if __name__ == '__main__':
    main()

when run produces an edit which is not marked as bot edit, as seen in https://en.wikipedia.org/w/index.php?title=User:Dreamy_Jazz_Bot/Links_added_to_portals_which_need_checking&diff=881488118&oldid=881487499. I don't know if this a pywikibot issue or a wiki issue.

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptFeb 2 2019, 10:25 PM

To follow up, the login function does not affect this. Without the line, the code still does not mark the edit as a bot edit.

Dreamy_Jazz updated the task description. (Show Details)Feb 2 2019, 10:27 PM
JJMC89 added a subscriber: JJMC89.Feb 2 2019, 11:09 PM

This ticket and T215108: The bot group is not properly detected on pywikibot.site.editpage() suggest that you have an authentication/permissions problem.

Assuming you are using BotPasswords or OAuth, have you enabled the highvolume grant? If you haven't, the account is treated as not having the bot right.

Dreamy_Jazz added a comment.EditedFeb 3 2019, 7:51 AM

I have enabled the highvolume grant and this fixed the problem with the groups, but even with the bot group and "botflag=True" the edits don't show up with the botflag. For example (https://en.wikipedia.org/w/index.php?title=Yu-Gi-Oh!&diff=prev&oldid=881544738) was performed with the aforementioned grant, but the "b" is not there and it still shows up in watchlists.

JJMC89 added a comment.Feb 3 2019, 8:15 AM

That edit is flagged as a bot edit. Bot edits are not marked in page histories, only recent changes. You might be able to find the edit in Special:RecentChanges if you check soon enough.

See below recent edits from your bot. rc_bot=1 means it is a bot edit.

MariaDB [enwiki_p]> select rc_timestamp, rc_user_text, rc_namespace, rc_title, rc_minor, rc_bot, rc_this_oldid from recentchanges where rc_user_text = 'Dreamy Jazz Bot' and rc_timestamp rlike '2019020[23]';
+----------------+-----------------+--------------+------------------------------------------------------------+----------+--------+---------------+
| rc_timestamp   | rc_user_text    | rc_namespace | rc_title                                                   | rc_minor | rc_bot | rc_this_oldid |
+----------------+-----------------+--------------+------------------------------------------------------------+----------+--------+---------------+
| 20190202204258 | Dreamy Jazz Bot |            2 | Dreamy_Jazz_Bot/Empty_portals                              |        1 |      0 |     881474368 |
| 20190202205124 | Dreamy Jazz Bot |            0 | 2011_Tōhoku_earthquake_and_tsunami                         |        1 |      0 |     881475771 |
| 20190202205154 | Dreamy Jazz Bot |           14 | A_Nightmare_on_Elm_Street                                  |        1 |      0 |     881475830 |
| 20190202211738 | Dreamy Jazz Bot |          100 | A_Nightmare_on_Elm_Street                                  |        1 |      0 |     881479720 |
| 20190202211738 | Dreamy Jazz Bot |           14 | Portals_needing_placement_of_incoming_links                |        0 |      0 |     881479720 |
| 20190202211828 | Dreamy Jazz Bot |          100 | A-League                                                   |        1 |      0 |     881479802 |
| 20190202211828 | Dreamy Jazz Bot |           14 | Portals_needing_placement_of_incoming_links                |        0 |      0 |     881479802 |
| 20190202211848 | Dreamy Jazz Bot |           14 | Belo_Corporation                                           |        1 |      0 |     881479843 |
| 20190202212125 | Dreamy Jazz Bot |          100 | Abbott_and_Costello                                        |        1 |      0 |     881480200 |
| 20190202212125 | Dreamy Jazz Bot |           14 | Portals_needing_placement_of_incoming_links                |        0 |      0 |     881480200 |
| 20190202212333 | Dreamy Jazz Bot |            2 | Dreamy_Jazz_Bot/Links_added_to_portals_which_need_checking |        1 |      0 |     881480437 |
| 20190202212333 | Dreamy Jazz Bot |           14 | Noindexed_pages                                            |        0 |      0 |     881480437 |
| 20190202213420 | Dreamy Jazz Bot |           14 | Wide_World_of_Sports_(U.S._TV_series)                      |        1 |      0 |     881482081 |
| 20190202213501 | Dreamy Jazz Bot |            0 | Abdul_Hamid_II                                             |        1 |      0 |     881482196 |
| 20190202213540 | Dreamy Jazz Bot |            2 | Dreamy_Jazz_Bot/Links_added_to_portals_which_need_checking |        1 |      0 |     881482282 |
| 20190202213540 | Dreamy Jazz Bot |           14 | Wide_World_of_Sports_(U.S._TV_series)                      |        0 |      0 |     881482282 |
| 20190202221454 | Dreamy Jazz Bot |            2 | Dreamy_Jazz_Bot/Links_added_to_portals_which_need_checking |        1 |      0 |     881487213 |
| 20190202221723 | Dreamy Jazz Bot |            2 | Dreamy_Jazz_Bot/Links_added_to_portals_which_need_checking |        1 |      0 |     881487499 |
| 20190202222238 | Dreamy Jazz Bot |            2 | Dreamy_Jazz_Bot/Links_added_to_portals_which_need_checking |        1 |      0 |     881488118 |
| 20190202222614 | Dreamy Jazz Bot |            2 | Dreamy_Jazz_Bot/Links_added_to_portals_which_need_checking |        1 |      0 |     881488558 |
| 20190203000731 | Dreamy Jazz Bot |            4 | WikiProject_Portals/Wanted_portals                         |        1 |      0 |     881499726 |
| 20190203074350 | Dreamy Jazz Bot |            2 | Dreamy_Jazz_Bot/Links_added_to_portals_which_need_checking |        1 |      1 |     881544320 |
| 20190203074640 | Dreamy Jazz Bot |            2 | Dreamy_Jazz_Bot/Links_added_to_portals_which_need_checking |        1 |      0 |     881544553 |
| 20190203074726 | Dreamy Jazz Bot |           14 | Yu-Gi-Oh!                                                  |        1 |      1 |     881544590 |
| 20190203074951 | Dreamy Jazz Bot |            0 | Yu-Gi-Oh!                                                  |        1 |      1 |     881544738 |
| 20190203074640 | Dreamy Jazz Bot |           14 | Wide_World_of_Sports_(U.S._TV_series)                      |        0 |      0 |     881544553 |
+----------------+-----------------+--------------+------------------------------------------------------------+----------+--------+---------------+
26 rows in set (4.00 sec)
Xqt closed this task as Invalid.Feb 3 2019, 9:46 AM
Xqt added a subscriber: Xqt.

Page.save(botflag=None) which is the default keyword parameter value also sets the botflag if the user has one.

To show the botflag edit in list other than rc please file a task for mediawiki itself

Thanks for your help. I assumed that bot edits get marked with the lowercase b.