https://bugzilla.wikimedia.org/show_bug.cgi?id=55311
Web browser: --- Bug ID: 55311 Summary: -weblink case sensitive Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: legoktm.wikipedia@gmail.com Classification: Unclassified Mobile Platform: ---
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/861/ Reported by: platonides Created on: 2009-02-18 15:49:13 Subject: -weblink case sensitive Original description: If you do use -weblink with an upper case parameter (or lowercase if the links are uppercase at the wiki), it treats the link as a page. Eg. for -weblink:*.COM and [u'http://www.example.com', u'Foo'] it outputs: Page [[Http://www.example.com]] not found No changes were necessary in [[Foo]]
Running r6366. Python 2.5.1
https://bugzilla.wikimedia.org/show_bug.cgi?id=55311
--- Comment #1 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- Okay, understood.
Actually, -weblink "case" does not change the replacements behavior. -weblink is, at all times, case insensitive: Here, if [[Foo]] contains 'Http://www.example.com', it will be matched by mediawiki as a *.COM address, and will give it to you on Special:LinkSearch.
It's not -weblink's case which matters here, it is the case (in)sensivity of the replacements used by replace.py
To illustrate what I'm saying: with http://fr.wikipedia.org/wiki/Utilisateur:NicDumZ/casetest containing "http://Case-Linky.COM" : python replace.py -weblink:"Case-Linky.COM" "case-linky.com" "case-linky.rs" treats the test page but don't change anything python replace.py -weblink:"case-linky.com" "case-linky.com" "case-linky.rs" treats the test page but don't change anything either
The page is matched as containing a case-linky.com link, because mediawiki treats links case-insensitively. But when PYWP tries to match replacements, it's case sensitive by default ;)
Add -nocase for case insensivity : python replace.py -weblink:"case-linky.com" -nocase "case-linky.com" "case-linky.rs" DO the changes =)
I'll close this bug as INVALID, re-open it if I misunderstood the issue =)
(But I think that you wanted the .yu top level domain fixes to be case-insensitive, right ? Well this was not possible, even with a -nocase parameter added, because -nocase is ignored when -fix: is used. But since http://svn.wikimedia.org/viewvc/pywikipedia?view=rev&revision=6374 the yu-tld fixes are case-insensitive. =) )
https://bugzilla.wikimedia.org/show_bug.cgi?id=55311
--- Comment #2 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- - **status**: open --> pending-invalid
https://bugzilla.wikimedia.org/show_bug.cgi?id=55311
--- Comment #3 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- Comment: the fact that the -linksearch pagegenerator yields the link itself (see bug description, "Page [[Http://www.example.com]] not found") is a regex bug, and is not related to the current bug. I have a patch ready, will commit asap.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55311
--- Comment #4 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- I don't mean that. Seems that by generalising it wasn't clear enough. At your example, run python replace.py -weblink:"Case-Linky.com" "case-linky.com" "case-linky.rs" Note that now the case of the weblink parameter (Case-Linky.com) doesn't match the case of the real link (http://Case-Linky.COM%5C) You will get a wrong 'Page [[Http://Case-Linky.COM]] not found' message. It is detecting two pages, http://Case-Linky.COM and Utilisateur:NicDumZ/casetest but only Utilisateur:NicDumZ/casetest is a pagename.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55311
--- Comment #5 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- - **status**: pending-invalid --> open-invalid
https://bugzilla.wikimedia.org/show_bug.cgi?id=55311
--- Comment #6 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- I can find that bug, but from the description seems this bug is a duplicate.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55311
Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://sourceforge.net/p/p | |ywikipediabot/bugs/861
pywikipedia-bugs@lists.wikimedia.org