cloudfoundry-community/cf-python-client

Deprecation warning due to invalid escape sequences

Closed this issue · 0 comments

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 {}
./main/cloudfoundry_client/operations/push/push.py:22: DeprecationWarning: invalid escape sequence \d
  SPLIT_ROUTE_PATTERN = re.compile('(?P<protocol>[a-z]+://)?(?P<domain>[^:/]+)(?P<port>:\d+)?(?P<path>/.*)?')
./main/cloudfoundry_client/operations/push/push.py:343: DeprecationWarning: invalid escape sequence \s
  return re.sub('[\s_]+', "-", h)
./main/cloudfoundry_client/operations/push/validation/manifest.py:9: DeprecationWarning: invalid escape sequence \d
  MEMORY_PATTERN = re.compile("^(\d+)([KMGT])B?$")