py-readability-metrics icon indicating copy to clipboard operation
py-readability-metrics copied to clipboard

DeprecationWarning: invalid escape sequence '\134/'

Open reefwing opened this issue 4 months ago • 0 comments

I am receiving the following deprecation warning (macOS, Python v3.11, py-readability-metrics v1.4.5):

.../readability/text/analyzer.py:132: DeprecationWarning: invalid escape sequence '\134/'
  match = re.match('^[.,\134/#!$%\134'\134^&\134*;:{}=\134-_`~()]$', token)

I think the problem is that the character \134 is supposed to represent an escape sequence, but it's invalid in this context. This could be fixed using something like:

match = re.match(r'^[.,\\\/#!$%\^&\*;:{}=\-_`~()]$', token)

reefwing avatar Mar 14 '24 06:03 reefwing