Skip to content

Deprecation warning due to invalid escape sequences in Python 3.7 #531

@tirkarthi

Description

@tirkarthi

Deprecation warning are raised due to invalid escape sequences. This can be fixed by using raw string or escaping them.

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

./src/webassets/filter/__init__.py:42: DeprecationWarning: invalid escape sequence \,
  """Split while allowing escaping.
./src/webassets/filter/replace.py:9: DeprecationWarning: invalid escape sequence \s
  """
./tests/test_filters.py:128: DeprecationWarning: invalid escape sequence \,
  os.environ['foo'] = 'one,two\,three'
./tests/test_filters.py:132: DeprecationWarning: invalid escape sequence \,
  m.config['foo'] = 'one,two\,three'
./tests/test_filters.py:133: DeprecationWarning: invalid escape sequence \,
  assert get_config(setting='foo', type=list) == 'one,two\,three'
./tests/test_filters.py:1387: DeprecationWarning: invalid escape sequence \S
  self.create_files({'backslashes.jst': """<input type="text" pattern="\S*"/>"""})

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