From aae2c6b3d4b565d5474dff576977283ef67f5dc4 Mon Sep 17 00:00:00 2001 From: pevisscher <2388946+pevisscher@users.noreply.github.com> Date: Mon, 24 Aug 2020 16:51:06 +0200 Subject: [PATCH] use correct re.sub signature `text_strip` currently passes the regex flags as the count parameters, which is hardcoded to `re.UNICODE` (value 32), and thus only replaces the first 32 values. see https://docs.python.org/3/library/re.html#re.sub for the signature --- camelot/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camelot/utils.py b/camelot/utils.py index 83974f9..3e8ab96 100644 --- a/camelot/utils.py +++ b/camelot/utils.py @@ -411,7 +411,7 @@ def text_strip(text, strip=""): return text stripped = re.sub( - fr"[{''.join(map(re.escape, strip))}]", "", text, re.UNICODE + fr"[{''.join(map(re.escape, strip))}]", "", text, flags=re.UNICODE ) return stripped