sloria / TextBlob

Simple, Pythonic, text processing--Sentiment analysis, part-of-speech tagging, noun phrase extraction, translation, and more.
https://textblob.readthedocs.io/
MIT License
9.09k stars 1.13k forks source link

Deprecation warning due to invalid escape sequences in Python 3.8 #302

Closed tirkarthi closed 7 months ago

tirkarthi commented 4 years ago

Deprecation warnings are raised due to invalid escape sequences in Python 3.8 . Below is a log of the warnings raised during compiling all the python files. Using raw strings or escaping them will fix this issue.

find . -iname '*.py'  | xargs -P 4 -I{} python -Wall -m py_compile {} 

./textblob/_text.py:218: DeprecationWarning: invalid escape sequence \.
  RE_ABBR1 = re.compile("^[A-Za-z]\.$")       # single letter, "T. De Smedt"
./textblob/_text.py:219: DeprecationWarning: invalid escape sequence \.
  RE_ABBR2 = re.compile("^([A-Za-z]\.)+$")    # alternating letters, "U.S."
./build/lib/textblob/_text.py:218: DeprecationWarning: invalid escape sequence \.
  RE_ABBR1 = re.compile("^[A-Za-z]\.$")       # single letter, "T. De Smedt"
./build/lib/textblob/_text.py:219: DeprecationWarning: invalid escape sequence \.
  RE_ABBR2 = re.compile("^([A-Za-z]\.)+$")    # alternating letters, "U.S."
./tests/test_translate.py:47: DeprecationWarning: invalid escape sequence \d
  assert_true(re.match('.+&tk=\d+\.\d+$', url))
sloria commented 7 months ago

this should be fixed in the latest release