Skip to content

DeprecationWarning: invalid escape sequence '\134/'Β #35

@reefwing

Description

@reefwing

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions