Page MenuHomePhabricator

generate_family_file.py should only accept family names that are valid for pywikibot
Closed, ResolvedPublic

Description

The script generate_family_file.py accepts family names that are later not usable for pywikibot which the throws an error:

Traceback (most recent call last):
  File "pwb.py", line 229, in <module>
    ['generate_user_files.py'])
  File "pwb.py", line 106, in run_python_file
    main_mod.__dict__)
  File "generate_user_files.py", line 481, in <module>
    main()
  File "generate_user_files.py", line 473, in main
    force=force)
  File "generate_user_files.py", line 311, in create_user_config
    main_family, main_code, main_username, force=force))]
  File "generate_user_files.py", line 126, in get_site_and_lang
    fam = pywikibot.family.Family.load(fam)
  File "/root/pywikibot/pywikibot/tools/__init__.py", line 1819, in wrapper
    return obj(*__args, **__kw)
  File "/root/pywikibot/pywikibot/family.py", line 1010, in load
    'Name of family %s must be ASCII characters and digits' % fam
AssertionError: Name of family madgn_it must be ASCII characters and digits

Event Timeline

Change 633805 had a related patch set uploaded (by Mpaa; owner: Mpaa):
[pywikibot/core@master] [bugfix] accept only valid names in generate_family_file.py

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

Change 633805 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] accept only valid names in generate_family_file.py

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

Xqt assigned this task to Mpaa.