Last modified: 2013-10-24 22:20:06 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 T57141, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55141 - WikiData: error for non-main namespace item
WikiData: error for non-main namespace item
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
Wikidata (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Amir Ladsgroup
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-05 04:31 UTC by Kunal Mehta (Legoktm)
Modified: 2013-10-24 22:20 UTC (History)
2 users (show)

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


Attachments

Description Kunal Mehta (Legoktm) 2013-10-05 04:31:13 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1630/
Reported by: beta16
Created on: 2013-04-29 15:30:25
Subject: WikiData: error for non-main namespace item
Original description:
Hi\! Following the istructions in \[\[:mw:Manual:Pywikipediabot/Wikidata\]\], I try this simple program:

import pywikibot
site = pywikibot.getSite\('en', 'wikipedia'\)
repo = site.data\_repository\(\)
page = pywikibot.Page\(site, "Wikipedia:Unchi Bassi"\)
data = pywikibot.DataPage\(page\)
dictionary = data.get\(\)

But the system return this error:
pywikibot.exceptions.NoSuchSite: Language wikidata does not exist in family wikipedia


Version:
Pywikipedia \[http\] trunk/pywikipedia \(r11483, 2013/04/28, 17:04:21, OUTDATED\)
Python 2.6.5 \(r265:79063, Oct  1 2012, 22:04:36\)
\[GCC 4.4.3\]
config-settings:
use\_api = True
use\_api\_login = True
unicode test: ok
Comment 1 Kunal Mehta (Legoktm) 2013-10-05 04:31:15 UTC
- **summary**: WikiData: error for non-mainnamespace item --> WikiData: error for non-main namespace item
Comment 2 Kunal Mehta (Legoktm) 2013-10-05 04:31:17 UTC
You did it in a very bad way you simply must use:
page = pywikibot.Page\(site, "Wikipedia:Unchi Bassi"\)
data = pywikibot.DataPage\(page\)
data.get\(\)
Comment 3 Kunal Mehta (Legoktm) 2013-10-05 04:31:19 UTC
You're right. But this is only a very simple example which follows strictly the instructions to reproduce the error.
Comment 4 Kunal Mehta (Legoktm) 2013-10-05 04:31:20 UTC
instructions said you can use one of two ways I'll correct that and I'll make a more clear documentation

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


Navigation
Links