jenkins-bot submitted this change.
[bugfix] use uppercased IP user titles
Bug: T306291
Change-Id: Id9132581ebc43843670344a325ccd8b9aed3402d
---
M pywikibot/page/_links.py
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pywikibot/page/_links.py b/pywikibot/page/_links.py
index 5e6dd09..1594253 100644
--- a/pywikibot/page/_links.py
+++ b/pywikibot/page/_links.py
@@ -18,7 +18,7 @@
from pywikibot import textlib
from pywikibot.exceptions import InvalidTitleError, SiteDefinitionError
from pywikibot.site import Namespace
-from pywikibot.tools import ComparableMixin, first_upper
+from pywikibot.tools import ComparableMixin, first_upper, is_ip_address
__all__ = (
@@ -485,7 +485,10 @@
'The link [[{}]] does not contain a page title'
.format(self._text))
- if self._site.namespaces[self._namespace].case == 'first-letter':
+ # MediaWiki uses uppercase IP addresses
+ if self._namespace in (2, 3) and is_ip_address(t):
+ t = t.upper()
+ elif self._site.namespaces[self._namespace].case == 'first-letter':
t = first_upper(t)
self._title = t
To view, visit change 783444. To unsubscribe, or for help writing mail filters, visit settings.