https://bugzilla.wikimedia.org/show_bug.cgi?id=55170
Web browser: --- Bug ID: 55170 Summary: trunk 10450 not py2.6 compatible Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: legoktm.wikipedia@gmail.com Classification: Unclassified Mobile Platform: ---
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1519/ Reported by: drtrigon Created on: 2012-10-09 15:08:56 Subject: trunk 10450 not py2.6 compatible Original description: 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
https://bugzilla.wikimedia.org/show_bug.cgi?id=55170
--- Comment #1 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- This ist still a fix-me of python release change r8814 which was done to fix another regex bug. mybe we had to create version dependant code :-(
https://bugzilla.wikimedia.org/show_bug.cgi?id=55170
Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://sourceforge.net/p/p | |ywikipediabot/bugs/1519
https://bugzilla.wikimedia.org/show_bug.cgi?id=55170
Amir Ladsgroup ladsgroup@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Priority|Unprioritized |Low CC| |ladsgroup@gmail.com Version|unspecified |compat (1.0) Summary|trunk 10450 not py2.6 |compat not py2.6 compatible |compatible |
https://bugzilla.wikimedia.org/show_bug.cgi?id=55170
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Blocks| |70987
pywikipedia-bugs@lists.wikimedia.org