Last modified: 2014-09-18 07:43:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57170, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55170 - compat not py2.6 compatible
compat not py2.6 compatible
Status: NEW
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
compat-(1.0)
All All
: Low normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks: py26
  Show dependency treegraph
 
Reported: 2013-10-05 04:37 UTC by Kunal Mehta (Legoktm)
Modified: 2014-09-18 07:43 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kunal Mehta (Legoktm) 2013-10-05 04:37:14 UTC
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
Comment 1 Kunal Mehta (Legoktm) 2013-10-05 04:37:16 UTC
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 :-\(

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links