Page MenuHomePhabricator

"step" is None but compared with an int inside site.loadrevisions
Closed, ResolvedPublic

Description

Got the following error while trying to save some text in a category that had just been moved:

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    cat.put(newtext, summary, minorEdit=False)
  File "...\pywikibot-core\pywikibot\tools\__init__.py", line 1357, in wrapper
    return obj(*__args, **__kw)
  File "...\pywikibot-core\pywikibot\page.py", line 1243, in put
    **kwargs)
  File "...\pywikibot-core\pywikibot\tools\__init__.py", line 1357, in wrapper
    return obj(*__args, **__kw)
  File "...\pywikibot-core\pywikibot\page.py", line 1160, in save
    cc=apply_cosmetic_changes, quiet=quiet, **kwargs)
  File "...\pywikibot-core\pywikibot\page.py", line 1171, in _save
    watch=watch, bot=botflag, **kwargs)
  File "...\pywikibot-core\pywikibot\site.py", line 1304, in callee
    return fn(self, *args, **kwargs)
  File "...\pywikibot-core\pywikibot\site.py", line 4766, in editpage
    lastrev = page.latest_revision
  File "...\pywikibot-core\pywikibot\page.py", line 522, in latest_revision
    return next(self.revisions(content=True, total=1))
  File "...\pywikibot-core\pywikibot\tools\__init__.py", line 1357, in wrapper
    return obj(*__args, **__kw)
  File "...\pywikibot-core\pywikibot\page.py", line 1573, in revisions
    total=total, rollback=rollback)
  File "...\pywikibot-core\pywikibot\site.py", line 3802, in loadrevisions
    if step > 0:
TypeError: unorderable types: NoneType() > int()

(I'm using Python 3)

Details

Related Gerrit Patches:

Event Timeline

Dalba created this task.Mar 4 2016, 11:30 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 4 2016, 11:30 AM
Restricted Application added a subscriber: pywikibot-bugs-list. · View Herald TranscriptMar 4 2016, 11:31 AM

Change 274933 had a related patch set uploaded (by Dalba):
site.loadrevisions: Do not compare step with 0 as it may be None

https://gerrit.wikimedia.org/r/274933

Change 274933 merged by jenkins-bot:
site.loadrevisions: Do not compare step with 0 as it may be None

https://gerrit.wikimedia.org/r/274933

Xqt closed this task as Resolved.Mar 4 2016, 1:33 PM
Xqt claimed this task.
Mpaa added a subscriber: Mpaa.Mar 4 2016, 8:42 PM

@Xqt, I missed why step has not been removed from loadrevisions in https://gerrit.wikimedia.org/r/266476.