Last modified: 2014-07-30 00:03:05 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 T67262, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65262 - ns parameter of Page object and/or defaultnamespace of Link object should force the namespace
ns parameter of Page object and/or defaultnamespace of Link object should for...
Status: PATCH_TO_REVIEW
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks: 55174 55265
  Show dependency treegraph
 
Reported: 2014-05-13 16:09 UTC by xqt
Modified: 2014-07-30 00:03 UTC (History)
1 user (show)

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


Attachments

Description xqt 2014-05-13 16:09:52 UTC
ns parameter of Page object and/or defaultnamespace of Link object should force the Namespace instead of add a Namespace if no one is given.

Especially for categories but also for other namespaces it is possible to name pages which looks like a Namespace e.g. "Kategory:Wikipedia:Hilfe".

site = pywikibot.Site()
pywikibot.Category(pywikibot.Link("Wikipedia:Hilfe"), defaultNamespace=14) or
pywikibot.Category(site, "Wikipedia:Hilfe", ns=14)

fails with an exception error

pywikibot.Page(site, "Wikipedia:Hilfe", ns=14) gives
Page("Wikipedia:Hilfe") instead of the category page as expected.

There are several scripts which fix that point by adding a "category:" in front of a page title which should be obsolete.

See https://gerrit.wikimedia.org/r/#/c/132781/ for example
Comment 1 John Mark Vandenberg 2014-07-30 00:03:05 UTC
https://gerrit.wikimedia.org/r/#/c/148337/

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


Navigation
Links