Last modified: 2013-10-05 05:02:53 UTC
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
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. =\) \)
- **status**: open --> pending-invalid
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.
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\) 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.
- **status**: pending-invalid --> open-invalid
I can find that bug, but from the description seems this bug is a duplicate.