Bugs item #1725373, was opened at 2007-05-25 04:22 Message generated for change (Settings changed) made by russblau You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1725373...
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: Closed Resolution: Fixed
Priority: 5 Private: No Submitted By: Byrial Ole Jensen (byrial) Assigned to: Nobody/Anonymous (nobody) Summary: redirect.py double -xml fails to find all double redirects
Initial Comment: redirect.py double -xml fails to find all double redirects. For example dawiki-20070522-pages-meta-current.xml contains 99 double redirects, redirect.py could only find 6 of these and correct 5 (The 6. was a redirect directly to itself). The full list of the 99 double redirects is at http://da.wikipedia.org/wiki/Wikipedia:Dobbelte_omdirigeringer (Permanent link in case the page is edited: http://da.wikipedia.org/w/index.php?title=Wikipedia:Dobbelte_omdirigeringer&...).
PS. It would also be nice to an option to read the double redirects from a file.
----------------------------------------------------------------------
Comment By: Russell Blau (russblau)
Date: 2008-02-28 17:57
Message: Logged In: YES user_id=855050 Originator: NO
Not sure when it was done, but the current version of redirect.py contains code that should have fixed this bug.
----------------------------------------------------------------------
Comment By: Byrial Ole Jensen (byrial) Date: 2007-05-25 13:42
Message: Logged In: YES user_id=23252 Originator: YES
I found that all the not found double redirects have a target which contain spaces and therefore made this patch to fix the problem:
RCS file: /cvsroot/pywikipediabot/pywikipedia/redirect.py,v retrieving revision 1.56 diff -u -r1.56 redirect.py --- redirect.py 11 May 2007 11:42:27 -0000 1.56 +++ redirect.py 25 May 2007 17:37:26 -0000 @@ -110,9 +110,9 @@ break # if the redirect does not link to another wiki if target: - target = target.replace(' ', '_') # remove leading and trailing whitespace target = target.strip() + target = target.replace('_', ' ') # capitalize the first letter if not wikipedia.getSite().nocapitalize: target = target[0].upper() + target[1:]
It solves the problem when you get double redirects from an XML dump. However I guess that the patch as is will break fixing double redirects fetched from [[Special:DoubleRedirects]], but this is not tested.
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1725373...