I was tempted in a first step to say that I would prefer to keep backward compatibility, having isRedirectPage to match only hard redirects, and changing our skip tests to ( p.isRedirectPage() or p.is_category_redirect() ) where necessary, to be sure that nothing breaks. But on a second thought... both approaches make sense.
I was worried that the maintenance on the category redirect pages would be hard to do with that change; but I checked replace.py in that view, and since content is retrieved with get_redirect=True, I found no inconvenient. I'll grep through our codebase to double check all usages of isRedirectPage and the raised IsRedirectPage ... (If ambiguous usages are found, we could introduce a config+commandline variable, something along the lines of ignoreCategoryRedirects ... ) 2009/1/13 Russell Blau <[email protected]>: > I've been working on implementing the category redirect detection suggested > by Lars Aronsson > (https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1722782&group_id=93107), > but I have a question for other developers. A category redirect is > implemented as a "soft redirect"; that is, a template is placed on the page > marking it as a redirect, but it does not use the #REDIRECT magic word of > the MediaWiki software, so the server doesn't treat it as a redirect. As > proposed, a category page (p) that contains a "soft" category redirect would > return True both to p.isRedirectPage() and to p.is_category_redirect(); the > only way to tell hard redirects apart from soft redirects would be to do > something like: > > if p.isRedirectPage() and not p.is_category_redirect(): > handle_hard_redirects_only() > > The question is, if pages that are not hard redirects return True to > p.isRedirectPage(), will this break anything else? > > Russ > > > _______________________________________________ > Pywikipedia-l mailing list > [email protected] > https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l > -- Nicolas Dumazet — NicDumZ [ nɪk.d̪ymz ] _______________________________________________ Pywikipedia-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
