This is really a bug in the current implementation of Page.title(). I guess you 
have
family = 'commons'
in your user-config.py
If you change it to 'wikipedia' (as a work-around) it will work as expected. 
But this must be fixed.

Greetings
xqt


----- Original Nachricht ----
Von:     "Tuszynski, Jaroslaw W." <[email protected]>
An:      Pywikipedia discussion list <[email protected]>
Datum:   04.03.2013 18:34
Betreff: [Pywikipedia-l] interlanguage links from Wikidata

> Today I was trying to switch some code of mine from old fashion interwiki to
> wikidata based. I found
> http://www.mediawiki.org/wiki/Manual:Pywikipediabot/Wikidata#Getting_data
> page and based on that I wrote:
> 
>  
> 
> #!/usr/bin/python
> 
> # -*- coding: utf-8  -*-
> 
>  
> 
> import wikipedia as pywikibot
> 
>  
> 
> if __name__ == "__main__":
> 
>     try:
> 
>         site = pywikibot.getSite(u'it', u'wikipedia')
> 
>         page = pywikibot.Page(site, 'Fabio degli Abati Olivieri')
> 
>         data = pywikibot.DataPage(page)
> 
>         language_links = data.interwiki()
> 
>         for page in language_links:
> 
>           print page.title(asLink=True)
> 
>     finally:
> 
>         pywikibot.stopme()
> 
>  
> 
> The output was: 
> 
> [[commons:fr:Fabio Olivieri]]
> 
> [[commons:de:Fabio Olivieri]]
> 
> [[commons:it:Fabio degli Abati Olivieri]]
> 
>  
> 
> Which seem to point to non existing language specific Commons sites instead
> of Wikipedias.  I worked around this issue, but what is the source of this
> issue: Wikidata, Italian Wikipedia, pywikipediabot?
> 
>  
> 
> Jarek T.
> 
> User:jarekt
> 
> 
> 
> --------------------------------
> 
> _______________________________________________
> Pywikipedia-l mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
> 

_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to