Bugs item #3575760, was opened at 2012-10-09 08:08 Message generated for change (Tracker Item Submitted) made by drtrigon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3575760...
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: trunk Status: Open Resolution: None Priority: 5 Private: No Submitted By: Dr. Trigon (drtrigon) Assigned to: Nobody/Anonymous (nobody) Summary: trunk 10450 not py2.6 compatible
Initial Comment: Hello all!
As Merlijn suggested at [1] I should also report this here too. I would solve it myself but a quick shot does not seam appropriate.
[1] https://jira.toolserver.org/browse/TS-1466
Python code using:
import re re.sub(..., flags=...)
does not work in python 2.6 because the optional parameter 'flags' was introduced in python 2.7. As Merlijn noted, this should be replaced by
re.compile(..., flags=...).sub(...)
A fast 'grep "flags" *' in my pywikipedia directory of revision 10450, yields at least following matches:
imagecopy_self.py: match = re.search(regex, text, flags=re.IGNORECASE) imagecopy_self.py: contents[u'permission'] = re.sub(regex, u'', contents[u'permission'], flags=re.IGNORECASE) imagecopy_self.py: text = re.sub(toRemove, u'', text, flags=re.IGNORECASE) imagecopy_self.py: text = re.sub(regex, u'', text, flags=re.IGNORECASE) imagecopy_self.py: match = re.search(regex, text, flags=re.IGNORECASE) imagecopy_self.py: result = re.sub(regex, replacement, match.group(0), flags=re.IGNORECASE)
...so there are at least 4 problematic cases which should be changed. I am not aware if a similar issues exists with 're.search'.
Thanks and greetings
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3575760...
pywikipedia-bugs@lists.wikimedia.org