Skip to content

Commit

Permalink
Fix "invalid escape sequence" warning. (#50)
Browse files Browse the repository at this point in the history
Fix "invalid escape sequence" warning.

Beginning with Python 3.6 a DeprecationWarning is shown when an invalid
escape sequence is used. Converting the string into a raw string fixes
the problem.

cf
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior

Fixes #49
  • Loading branch information
jugmac00 committed Dec 15, 2018
1 parent 0b8b63a commit 2219ecc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -5,6 +5,7 @@ Changelog
----------------

- Replace deprecated ``cgi.escape`` with ``html.escape`` for Python 3.
- Fix "invalid escape sequence" warning in Python 3.


4.2 (2018-10-05)
Expand Down
2 changes: 1 addition & 1 deletion src/Products/ZCTextIndex/tests/testZCTextIndex.py
Expand Up @@ -239,7 +239,7 @@ def testDocUpdate(self):
d = {} # word -> list of version numbers containing that word
for version, i in zip(text, range(N)):
# use a simple splitter rather than an official one
words = [w for w in re.split('\W+', version.lower())
words = [w for w in re.split(r'\W+', version.lower())
if len(w) > 1 and w not in stop]
word_seen = {}
for w in words:
Expand Down

0 comments on commit 2219ecc

Please sign in to comment.