Skip to content

Deprecation warnings over invalid escape sequences in Python 3.7 #10

@tirkarthi

Description

@tirkarthi

Deprecation warning are generated over invalid escape sequences. This can be fixed by using raw strings or escaping the literals again.

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

./patch_ng.py:420: DeprecationWarning: invalid escape sequence \d
  re_hunk_start = re.compile(b"^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@")
./patch_ng.py:614: DeprecationWarning: invalid escape sequence \+
  re_filename_date_time = b"^\+\+\+ ([^\t]+)(?:\s([0-9-]+)\s([0-9:]+)|.*)"
./patch_ng.py:571: DeprecationWarning: invalid escape sequence \s
  re_filename_date_time = b"^--- ([^\t]+)(?:\s([0-9-]+)\s([0-9:]+)|.*)"
./patch_ng.py:646: DeprecationWarning: invalid escape sequence \d
  match = re.match(b"^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@(.*)", line)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions