Page MenuHomePhabricator

TypeError in clean_sandbox
Closed, ResolvedPublic

Description

C:\pwb\GIT\core>pwb.py clean_sandbox -lang:als
Preparing to process sandbox page [[Wikipedia:Sandchaschte]]
Traceback (most recent call last):
  File "C:\pwb\GIT\core\pwb.py", line 239, in <module>
    if not main():
  File "C:\pwb\GIT\core\pwb.py", line 233, in main
    run_python_file(filename, argv, argvu, file_package)
  File "C:\pwb\GIT\core\pwb.py", line 88, in run_python_file
    main_mod.__dict__)
  File ".\scripts\clean_sandbox.py", line 294, in <module>
    main()
  File ".\scripts\clean_sandbox.py", line 291, in main
    bot.run()
  File ".\scripts\clean_sandbox.py", line 204, in run
    subst = 'subst:' in translatedContent
TypeError: argument of type 'NoneType' is not iterable

Event Timeline

Xqt raised the priority of this task from to Needs Triage.
Xqt updated the task description. (Show Details)
Xqt added projects: Pywikibot, Pywikibot-Scripts.
Xqt subscribed.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptMay 26 2015, 4:22 AM

bug caused by 1b2a7e93a1f040c08edb7c3e29c927a35794bafd

Okay I'd suggest to merge a modified version back in. The modified version first checks site's lang and if there is no such translation it uses site's code (and it should issue a deprecation warning).

Please don't. translate() is for L10N and shouldn't have fallback. twtranslate is for i18n and has fallback at least to 'en' which always work.

jayvdb claimed this task.
jayvdb subscribed.

@Xqt reverted 1b2a7e93a1f040c08edb7c3e29c927a35794bafd