jenkins-bot has submitted this change and it was merged.
Change subject: Fix bug 55265
......................................................................
Fix bug 55265
Just adding "Category:" prefix in order to avoid any misinterpretation between
namespace and il prefix
and using cat.title() instead of catTitle in order to avoid the bug
Change-Id: I072ebf11b2360fe9c04c23fa423bb44b4169db58
---
M category.py
M catlib.py
2 files changed, 3 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/category.py b/category.py
index 59ffddc..659cae5 100644
--- a/category.py
+++ b/category.py
@@ -415,14 +415,12 @@
site = pywikibot.getSite()
newCat = catlib.Category(site, self.newCatTitle)
# set edit summary message
-
if self.useSummaryForDeletion and self.editSummary:
reason = self.editSummary
else:
reason = i18n.twtranslate(site, 'category-was-moved',
{'newcat': self.newCatTitle,
'title': self.newCatTitle})
-
if not self.editSummary:
self.editSummary = i18n.twtranslate(site, 'category-changing',
{'oldcat': self.oldCat.title(),
@@ -433,7 +431,7 @@
oldMovedTalk = None
if self.oldCat.exists() and self.moveCatPage:
copied = self.oldCat.copyAndKeep(
- self.newCatTitle, pywikibot.translate(site, cfd_templates))
+ newCat.title(), pywikibot.translate(site, cfd_templates))
# Also move the talk page
if copied:
oldTalk = self.oldCat.toggleTalkPage()
diff --git a/catlib.py b/catlib.py
index 61fd798..6ed4f70 100644
--- a/catlib.py
+++ b/catlib.py
@@ -75,8 +75,8 @@
self.sortKey = sortKey
self.sortKeyPrefix = sortKeyPrefix
if self.namespace() != 14:
- raise ValueError(u'BUG: %s is not in the category namespace!'
- % title)
+ pywikibot.Page.__init__(self, site=site, title="Category:" + title,
insite=insite,
+ defaultNamespace=14)
self.completelyCached = False
self.articleCache = []
self.subcatCache = []
--
To view, visit
https://gerrit.wikimedia.org/r/132781
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I072ebf11b2360fe9c04c23fa423bb44b4169db58
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>