Legoktm has uploaded a new change for review.
https://gerrit.wikimedia.org/r/86442
Change subject: Don't choke on 'removed' labels.
......................................................................
Don't choke on 'removed' labels.
A label will have 'removed' if the serializer recieved bad
input like an empty string, so we should just skip that label
Bug: 54767
Change-Id: Ibf4645edfaf25a7ed9afa56484e924bd855f24ed
---
M pywikibot/page.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/42/86442/1
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 84c88cc..b1f931a 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -2418,7 +2418,8 @@
self.labels = {}
if 'labels' in self._content:
for lang in self._content['labels']:
- self.labels[lang] = self._content['labels'][lang]['value']
+ if not 'removed' in self._content['labels'][lang]: # Bug 54767
+ self.labels[lang] = self._content['labels'][lang]['value']
#descriptions
self.descriptions = {}
--
To view, visit https://gerrit.wikimedia.org/r/86442
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf4645edfaf25a7ed9afa56484e924bd855f24ed
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits