Morten Wang wrote: > On Tue, Jun 14, 2011 at 12:28 PM, Russell Blau <[email protected]> > wrote: ... >>> Creating it as a page with namespace set to 14 results in: >>> >>> myPage = pywikibot.Page(mySite, 'Wikipedia:Globalt >>> perspektiv-samtliga', ns=14); >>> >>> print myPage.title(); >>> Wikipedia:Globalt perspektiv-samtliga >>> >>> print myPage.namespace(); >>> 4 >>> >>> The title's namespace overrides the given option, which itsn't what I >>> would expect. >> >> That one does seem like a bug. The namespace number ought to match the >> actual title. I'll investigate further. > > Thanks, let me know if there's anything I can do to help!
Sorry for the delay in getting to this. On further study, this is exactly the same behavior as found in the original wikipedia.py. >>> import wikipedia >>> mySite = wikipedia.getSite() >>> myPage = wikipedia.Page(mySite, 'Wikipedia:Globalt perspektiv-samtliga', >>> defaultNamespace=14) >>> print myPage.title() Wikipedia:Globalt perspektiv-samtliga >>> print myPage.namespace() 4 So, if there is a bug, it is not in the rewrite branch but in the original design. I don't think it is a bug, though, because "defaultNamespace" is supposed to be applied only when the string passed to the Page constructor does not contain any namespace prefix. Russ _______________________________________________ Pywikipedia-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
