Hi,
I'm running into a problem with article titles that include ":", e.g. "Nomad: From Islam to America" (which exists on English Wikipedia: http://en.wikipedia.org/wiki/Nomad:_From_Islam_to_America ). I haven't been able to figure out if there's a way to instantiate pages like this one, neither through Google nor reading source code and trial & error. All I end up with is slamming into an exception because there's no "Nomad" family.
Is there a simple and straightforward way to do this?
Regards, Morten
On 24 October 2011 19:34, Morten Wang nettrom@gmail.com wrote:
I'm running into a problem with article titles that include ":", e.g. "Nomad: From Islam to America" (which exists on English Wikipedia: http://en.wikipedia.org/wiki/Nomad:_From_Islam_to_America ).
Is there a simple and straightforward way to do this?
There should be, but there isn't. imo Page('en', ':Nomad: From Islam to America') should just work (but it doesn't). Even this fails:
catlib.Category('en', 'Books by Ayaan Hirsi Ali').articlesList()
Getting [[Category:Books by Ayaan Hirsi Ali]]... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "catlib.py", line 431, in articlesList for article in self.articles(recurse, sortby=sortby, sortdir=sortdir): File "catlib.py", line 416, in articles sortby=sortby, sortdir=sortdir): File "catlib.py", line 169, in _getContentsNaive sortby=sortby, sortdir=sortdir): File "catlib.py", line 239, in _parseCategory yield ARTICLE, wikipedia.Page(self.site(), memb['title'], defaultNamespace=memb['ns']) File "wikipedia.py", line 374, in __init__ % (title, self._site, familyName)) pywikibot.exceptions.NoPage: Nomad: From Islam to America is not a local page on wikipedia:en, and the nomad family is not supported by PyWikipediaBot!
So: I added a bug report for you: https://sourceforge.net/tracker/?func=detail&aid=3427930&group_id=93...
Best, Merlijn
Please try to specify the problem. What is the command or script you use? I made an experiment as shown in the attachement: while using replace.py with the mentioned page in enwiki the problem really exists, another page from huwiki (default lang) may be well treated. So the problem is site-specific.
2011/10/24 Morten Wang nettrom@gmail.com
Hi,
I'm running into a problem with article titles that include ":", e.g. "Nomad: From Islam to America" (which exists on English Wikipedia: http://en.wikipedia.org/wiki/Nomad:_From_Islam_to_America ). I haven't been able to figure out if there's a way to instantiate pages like this one, neither through Google nor reading source code and trial & error. All I end up with is slamming into an exception because there's no "Nomad" family.
Is there a simple and straightforward way to do this?
Regards, Morten
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
On 24 October 2011 20:36, Bináris wikiposta@gmail.com wrote:
I made an experiment as shown in the attachement: while using replace.py with the mentioned page in enwiki the problem really exists, another page from huwiki (default lang) may be well treated. So the problem is site-specific.
See the bug ( http://toolserver.org/~pywikipedia/b3427930 ) -- the problem is that 'nomad' once was an interwiki key, but it no longer is. Therefore, it should be removed from the 'known families' list - the problem is that Page('en', 'nomad:blah') was interpreted as Page(getSite('en', 'nomad'), 'blah'), which is incorrect.
Merlijn
fixed in r9670
Greetings xqt
----- Original Nachricht ---- Von: Merlijn van Deen valhallasw@arctus.nl An: Pywikipedia discussion list pywikipedia-l@lists.wikimedia.org Datum: 24.10.2011 21:05 Betreff: Re: [Pywikipedia-l] Instantiating pages with ":" in title
On 24 October 2011 20:36, Bináris wikiposta@gmail.com wrote:
I made an experiment as shown in the attachement: while using replace.py with the mentioned page in enwiki the problem really exists, another page from huwiki (default lang) may be well treated. So the problem is site-specific.
See the bug ( http://toolserver.org/~pywikipedia/b3427930 ) -- the problem is that 'nomad' once was an interwiki key, but it no longer is. Therefore, it should be removed from the 'known families' list - the problem is that Page('en', 'nomad:blah') was interpreted as Page(getSite('en', 'nomad'), 'blah'), which is incorrect.
Merlijn
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Just wanted to thank everyone for helping getting this figured out! And of course a big thanks to xqt for checking in a fix to SVN so quickly!
Cheers, Morten
On Mon, Oct 24, 2011 at 2:15 PM, info@gno.de wrote:
fixed in r9670
Greetings xqt
----- Original Nachricht ---- Von: Merlijn van Deen valhallasw@arctus.nl An: Pywikipedia discussion list pywikipedia-l@lists.wikimedia.org Datum: 24.10.2011 21:05 Betreff: Re: [Pywikipedia-l] Instantiating pages with ":" in title
On 24 October 2011 20:36, Bináris wikiposta@gmail.com wrote:
I made an experiment as shown in the attachement: while using
replace.py
with the mentioned page in enwiki the problem really exists, another
page
from huwiki (default lang) may be well treated. So the problem is site-specific.
See the bug ( http://toolserver.org/~pywikipedia/b3427930 ) -- the
problem
is that 'nomad' once was an interwiki key, but it no longer is.
Therefore,
it should be removed from the 'known families' list - the problem is that Page('en', 'nomad:blah') was interpreted as Page(getSite('en', 'nomad'), 'blah'), which is incorrect.
Merlijn
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
pywikipedia-l@lists.wikimedia.org