Page MenuHomePhabricator

AttributeError: 'tuple' object has no attribute 'site' when running pagefromfile.py
Closed, DuplicatePublic

Description

ERROR: AttributeError: 'tuple' object has no attribute 'site'
Traceback (most recent call last):
  File "pwb.py", line 251, in <module>
    if not main():
  File "pwb.py", line 244, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 115, in run_python_file
    main_mod.__dict__)
  File ".\scripts\pagefromfile.py", line 344, in <module>
    main()
  File ".\scripts\pagefromfile.py", line 340, in main
    bot.run()
  File "C:\Users\VOJEN\Desktop\jonas\pywikibot-master\pywikibot\bot.py", line 14
70, in run
    if self.skip_page(page):
  File "C:\Users\VOJEN\Desktop\jonas\pywikibot-master\pywikibot\bot.py", line 16
26, in skip_page
    if page.site != self.site:
AttributeError: 'tuple' object has no attribute 'site'
<class 'AttributeError'>
CRITICAL: Closing network session.

when trying to run

python pwb.py pagefromfile.py -notitle

valhallasw`cloud at IRC suggested: I think it was broken in d582f9dd0a09872906abe1ba4c10074275e68a52. Can you try git checkout 31dc0fec0f4f6a1249fe094a4504d4055d664c46 and try again?

and explained: basically, pagefromfile.py does a weird thing where it passes a Page object /and/ content together, instead of just a Page object (which most other scripts do). Some framework code was added that requires that only the Page object is used, so that might have broken it

He was apparently right, because checking out 31dc0fec0f4f6a1249fe094a4504d4055d664c46 bypassed the problem and the script ran fine.

Event Timeline

Vvjjkkii renamed this task from AttributeError: 'tuple' object has no attribute 'site' when running pagefromfile.py to adbaaaaaaa.Jul 1 2018, 1:05 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from adbaaaaaaa to AttributeError: 'tuple' object has no attribute 'site' when running pagefromfile.py.Jul 2 2018, 3:03 PM
CommunityTechBot closed this task as a duplicate.
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.