Dalba added a comment.

After some tinkering with different configurations I think I have found the pattern in which this error occurs. It seems to be mostly to due mediawiki not being able to handle short userprefixes.

The following test uses ascii letters as user prefix, is very slow, and almost always fails for me on enwiki:

def test_user_prefix_reverse(self):
    """Test the site.usercontribs() method with range reversed."""
    mysite = self.get_site()
    import string
    for userprefix in string.ascii_uppercase:
        print(userprefix)
        for contrib in mysite.usercontribs(
                userprefix=userprefix,
                start=pywikibot.Timestamp.fromISOformat("2008-10-11T06:00:01Z"),
                end=pywikibot.Timestamp.fromISOformat("2008-10-11T23:59:59Z"),
                reverse=True, total=5):
            self.assertTrue(
                "2008-10-11T06:00:01Z" <= contrib['timestamp'] <= "2008-10-11T23:59:59Z")

The longer the userprefix, the higher chance of passing the test; which makes sense.

I'll upload a patch according to the observations above.


TASK DETAIL
https://phabricator.wikimedia.org/T134640

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Magul, Dalba
Cc: MtDu, Lokal_Profil, Dalba, gerritbot, valhallasw, XZise, Aklapper, jayvdb, Zppix, Xqt, pywikibot-bugs-list, Th3d3v1ls, Ramalepe, Liugev6, Magul, Tbscho, MayS, Lewizho99, Mdupont, JJMC89, Maathavan, Avicennasis, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to