Page MenuHomePhabricator

Read-only wikis (aka "RemovedSite") gives read errors that are not handled
Closed, DuplicatePublic

Description

huwikinews
Traceback (most recent call last):
  File "pywikibot-core/pwb.py", line 262, in <module>
    if not main():
  File "pywikibot-core/pwb.py", line 255, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pywikibot-core/pwb.py", line 121, in run_python_file
    main_mod.__dict__)
  File "test.py", line 14, in <module>
    if p.exists():
  File "pywikibot-core/pywikibot/page.py", line 803, in exists
    return self.site.page_exists(self)
  File "pywikibot-core/pywikibot/site.py", line 907, in __getattr__
    % (self.__class__.__name__, attr))
AttributeError: RemovedSite instance has no attribute 'page_exists'
<type 'exceptions.AttributeError'>
CRITICAL: Closing network session.

with something like

p = pwb.Page(pwb.Site('hu', 'wikinews'), 'Category:Published')
print(p.exists())

same error for .text AttributeError: RemovedSite instance has no attribute 'loadrevisions' and others

  • Errors are not handled, it should be something else than AttributeError
  • The wiki is in read-only mode, so PWB should be able to read it. Currently page.text and others gives unexpected errors

Event Timeline

Framawiki renamed this task from Bad error with RemovedSite to Read-only wikis (aka "RemovedSite") gives read errors that are not handled.Aug 27 2017, 5:53 PM
Framawiki updated the task description. (Show Details)

I experienced the same issue, complained here

Change 403620 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [IMPR] Load sites in closed_wikis in read-only mode

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

Change 403620 abandoned by Dvorapa:
[WIP][IMPR] Load sites in closed_wikis in read-only mode

Reason:
In favor of (WIP) https://gerrit.wikimedia.org/r/#/c/429875/

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