XZise added a comment.
Okay I'm confused. It works fine for me:
Python 2.7.8 (default, Aug 28 2014, 16:47:22) [GCC 4.8.3 20140624 (Red Hat 4.8.3-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import re re.match('A', u'Ö'.encode('latin1')) re.match(u'A', u'Ö'.encode('latin1')) re.sub(u'A', '', u'Ö'.encode('latin1'))
'\xd6'
re.sub(u'(?is)A', '', u'Ö'.encode('latin1'))
'\xd6'
xzise@localhost:~/Programms/pywikibot/core$ python Python 2.7.8 (default, Aug 28 2014, 16:47:22) [GCC 4.8.3 20140624 (Red Hat 4.8.3-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
from __future__ import unicode_literals import re re.sub(u'(?is)A', '', u'Ö'.encode('latin1'))
'\xd6'
re.sub('(?is)A', '', u'Ö'.encode('latin1'))
'\xd6'
R = re.compile('(?is)A') R.sub('', u'Ö'.encode('latin1'))
'\xd6'
TASK DETAIL https://phabricator.wikimedia.org/T94688
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: Ricordisamoa, jayvdb, XZise, Aklapper, Rubin16, pywikipedia-bugs