From b4cb042b66e48aab8597ac7e405543986a602e81 Mon Sep 17 00:00:00 2001 From: milde Date: Mon, 8 Jan 2018 23:29:19 +0000 Subject: [PATCH] Fix #338: re.sub() flag argument at wrong position. Thanks to Jakub Wilk for reporting. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8209 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/docutils/utils/smartquotes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docutils/docutils/utils/smartquotes.py b/docutils/docutils/utils/smartquotes.py index 58e57204b..aa1234ac0 100644 --- a/docutils/docutils/utils/smartquotes.py +++ b/docutils/docutils/utils/smartquotes.py @@ -653,7 +653,7 @@ def educateQuotes(text, language='en'): # Special case for decade abbreviations (the '80s): if language.startswith('en'): # TODO similar cases in other languages? - text = re.sub(r"""'(?=\d{2}s)""", smart.apostrophe, text, re.UNICODE) + text = re.sub(r"'(?=\d{2}s)", smart.apostrophe, text, flags=re.UNICODE) # Get most opening single quotes: opening_single_quotes_regex = re.compile(ur""" -- 2.11.4.GIT