Urbanecm created this task.
Urbanecm added a project: Pywikibot-core.
Herald added subscribers: pywikibot-bugs-list, Aklapper.
Herald added a project: User-Urbanecm.

TASK DESCRIPTION

Hello,

according to help(site.loadrevisions) page (quoted below) is mandatory unless ids is specified. It doesn't work, through. See following output.

Steps to reproduce
$ python
Python 2.7.6 (default, Nov 23 2017, 15:49:48) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywikibot
>>> site = pywikibot.Site()
>>> site.loadrevisions(revids=16114288)                                                                                                                                                                     
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/shared/pywikipedia/core/pywikibot/tools/__init__.py", line 1426, in wrapper
    return obj(*__args, **__kw)
TypeError: loadrevisions() takes at least 2 arguments (2 given)
>>> 



Help to site.loadrevisions
$ python
Python 2.7.6 (default, Nov 23 2017, 15:49:48) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywikibot
>>> site = pywikibot.Site()
>>> help(site.loadrevisions)
Help on method loadrevisions in module pywikibot.site:

loadrevisions(*__args, **__kw) method of pywikibot.site.APISite instance
    Retrieve and store revision information.
    
    By default, retrieves the last (current) revision of the page,
    unless any of the optional parameters revids, startid, endid,
    starttime, endtime, rvdir, user, excludeuser, or limit are
    specified. Unless noted below, all parameters not specified
    default to False.
    
    If rvdir is False or not specified, startid must be greater than
    endid if both are specified; likewise, starttime must be greater
    than endtime. If rvdir is True, these relationships are reversed.
    
    @param page: retrieve revisions of this Page (required unless ids
        is specified)
    @param content: if True, retrieve the wiki-text of each revision;
        otherwise, only retrieve the revision metadata (default)
    @type content: bool
    @param section: if specified, retrieve only this section of the text
        (content must be True); section must be given by number (top of
        the article is section 0), not name
    @type section: int
    @param revids: retrieve only the specified revision ids (raise
        Exception if any of revids does not correspond to page
    @type revids: an int, a str or a list of ints or strings
    @param startid: retrieve revisions starting with this revid
    @param endid: stop upon retrieving this revid
    @param starttime: retrieve revisions starting at this Timestamp
    @param endtime: stop upon reaching this Timestamp
    @param rvdir: if false, retrieve newest revisions first (default);
        if true, retrieve earliest first
    @param user: retrieve only revisions authored by this user
    @param excludeuser: retrieve all revisions not authored by this user
    @param sysop: if True, switch to sysop account (if available) to
        retrieve this page

I think this should be fixed.

Martin


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

WORKBOARD
https://phabricator.wikimedia.org/project/board/87/

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

To: Urbanecm
Cc: Aklapper, pywikibot-bugs-list, Urbanecm, Magul, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, jayvdb, Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to