CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.91k stars 235 forks source link

Deprecation warning due to invalid escape sequences #109

Closed tirkarthi closed 4 years ago

tirkarthi commented 4 years ago

Deprecation warnings are raised due to invalid escape sequences. This can be fixed by using raw strings or escaping the literals. pyupgrade also helps in automatic conversion : https://github.com/asottile/pyupgrade/

find . -iname '*.py' | xargs -P4 -I{} python3.8 -Wall -m py_compile {}
./examples/pizza.py:19: DeprecationWarning: invalid escape sequence \s
  ok = regex.match('^([01]{1})?[-.\s]?\(?(\d{3})\)?[-.\s]?(\d{3})[-.\s]?(\d{4})\s?((?:#|ext\.?\s?|x\.?\s?){1}(?:\d+)?)?$', document.text)
./examples/input.py:18: DeprecationWarning: invalid escape sequence \s
  ok = regex.match('^([01]{1})?[-.\s]?\(?(\d{3})\)?[-.\s]?(\d{3})[-.\s]?(\d{4})\s?((?:#|ext\.?\s?|x\.?\s?){1}(?:\d+)?)?$', document.text)
tirkarthi commented 4 years ago

This is mostly in example folder. I am not sure if this needs to be fixed. Closing. Sorry for the noise.