Last modified: 2014-10-21 14:18:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T71255, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69255 - Scripts fail if only family:wikidata is specified
Scripts fail if only family:wikidata is specified
Status: NEW
Product: Pywikibot
Classification: Unclassified
Wikidata (Other open bugs)
core-(2.0)
All All
: Lowest normal
: ---
Assigned To: Amir Ladsgroup
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-07 19:23 UTC by Mpaa
Modified: 2014-10-21 14:18 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Mpaa 2014-08-07 19:23:32 UTC
python pwb.py listpages.py -family:wikidata -start:A

Traceback (most recent call last):
  File "pwb.py", line 166, in <module>
    run_python_file(fn, argv, argvu)
  File "pwb.py", line 67, in run_python_file
    exec(compile(source, filename, "exec"), main_mod.__dict__)
  File "scripts/listpages.py", line 58, in <module>
    main()
  File "scripts/listpages.py", line 35, in main
    local_args = pywikibot.handleArgs(*args)
  File "/home/user/python/core/pywikibot/bot.py", line 638, in handleArgs
    init_handlers()
  File "/home/user/python/core/pywikibot/bot.py", line 246, in init_handlers
    writelogheader()
  File "/home/user/python/core/pywikibot/bot.py", line 257, in writelogheader
    site = pywikibot.Site()
  File "/home/user/python/core/pywikibot/__init__.py", line 527, in Site
    _sites[key] = __Site(code=code, fam=fam, user=user, sysop=sysop)
  File "/home/user/python/core/pywikibot/site.py", line 636, in __init__
    BaseSite.__init__(self, code, fam, user, sysop)
  File "/home/user/python/core/pywikibot/site.py", line 167, in __init__
    % (self.__code, self.__family.name))
pywikibot.exceptions.NoSuchSite: Language en does not exist in family wikidata
<class 'pywikibot.exceptions.NoSuchSite'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort


In site.py, the following fails:
 158     if (self.__family.name in list(self.__family.langs.keys()) and
 159             len(self.__family.langs) == 1):

len(self.__family.langs) is not 1:
{'test': 'test.wikidata.org', 'wikidata': 'www.wikidata.org'}
Comment 1 Amir Ladsgroup 2014-08-13 16:56:31 UTC
Do you really think this needs to fix? when there is a test repo (two wikis instead of one) so It's unreasonable to fix it
Comment 2 Mpaa 2014-08-13 18:41:06 UTC
There is an inconsistent status, so I would fix this.
Up to you and the others' opinion how to move FW.
Comment 3 John Mark Vandenberg 2014-10-21 14:18:26 UTC
(In reply to Mpaa from comment #2)
> There is an inconsistent status, so I would fix this.
> Up to you and the others' opinion how to move FW.

I agree this should be fixed.

Something like this should be OK; very little change of causing problems with custom family files.

-    len(self.__family.langs) == 1):
+    len(self.__family.langs - ('test')) == 1):

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links