[Pywikipedia-l] [ pywikipediabot-Bugs-2613069 ] -weblink case sensitive

SourceForge.net noreply at sourceforge.net
Thu Feb 19 03:58:09 UTC 2009


Bugs item #2613069, was opened at 2009-02-18 16:49
Message generated for change (Comment added) made by nicdumz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2613069&group_id=93107

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Pending
Resolution: Invalid
Priority: 5
Private: No
Submitted By: Platonides (platonides)
Assigned to: Nobody/Anonymous (nobody)
Summary: -weblink case sensitive

Initial Comment:
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


----------------------------------------------------------------------

>Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2009-02-19 04:58

Message:
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.

----------------------------------------------------------------------

Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2009-02-19 04:13

Message:
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. =) )


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2613069&group_id=93107



More information about the Pywikipedia-l mailing list