jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/783444 )

Change subject: [bugfix] use uppercased IP user titles
......................................................................

[bugfix] use uppercased IP user titles

Bug: T306291
Change-Id: Id9132581ebc43843670344a325ccd8b9aed3402d
---
M pywikibot/page/_links.py
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Matěj Suchánek: Looks good to me, approved
  jenkins-bot: Verified



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 https://gerrit.wikimedia.org/r/c/pywikibot/core/+/783444
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Id9132581ebc43843670344a325ccd8b9aed3402d
Gerrit-Change-Number: 783444
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to