Page MenuHomePhabricator

generate_user_files.py failing on Toolforge's /data/project/shared/pywikibot/stable
Closed, ResolvedPublicBUG REPORT

Description

Following tutorial at https://wikitech.wikimedia.org/wiki/Help:Toolforge/Pywikibot#Using_the_shared_Pywikibot_files_(recommended_setup)

$ become bd808-test2
$ export PYTHONPATH=/data/project/shared/pywikibot/stable:/data/project/shared/pywikibot/stable/scripts
$ mkdir $HOME/.pywikibot
$ python3 /data/project/shared/pywikibot/stable/generate_user_files.py
Traceback (most recent call last):
  File "/data/project/shared/pywikibot/stable/generate_user_files.py", line 473, in <module>
    main()
  File "/data/project/shared/pywikibot/stable/generate_user_files.py", line 443, in main
    local_args = pywikibot.handle_args(args)
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core_stable/pywikibot/bot.py", line 878, in handle_args
    pywikibot.Site()
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core_stable/pywikibot/tools/__init__.py", line 1434, in wrapper
    return obj(*__args, **__kw)
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core_stable/pywikibot/__init__.py", line 1249, in Site
    _sites[key] = interface(code=code, fam=fam, user=user)
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core_stable/pywikibot/tools/__init__.py", line 1517, in wrapper
    return obj(*new_args, **new_kwargs)
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core_stable/pywikibot/site/__init__.py", line 1705, in __init__
    BaseSite.__init__(self, code, fam, user)
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core_stable/pywikibot/tools/__init__.py", line 1517, in wrapper
    return obj(*new_args, **new_kwargs)
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core_stable/pywikibot/site/__init__.py", line 720, in __init__
    if code.lower() != code:
AttributeError: 'NoneType' object has no attribute 'lower'
CRITICAL: Exiting due to uncaught exception <class 'AttributeError'>

Event Timeline

Xqt triaged this task as High priority.Sep 1 2020, 7:07 PM
Xqt changed the subtype of this task from "Task" to "Bug Report".

I can reproduce it. This bug was introduced with rPWBC1d2b5950f

Change 623647 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Don't check for valid Family/Site if running generate_user_files.py

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

Change 623647 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Don't check for valid Family/Site if running generate_user_files.py

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

Change 623794 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [4.3] Publish 4.3.0 due to T261771

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

Change 623794 merged by jenkins-bot:
[pywikibot/core@master] [4.3] Publish 4.3.0 due to T261771

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

The fix should roll out in Toolforge around 2020-09-03 01:01 UTC when the next update job for /data/project/shared/pywikibot/stable runs.