Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation warning due to invalid escape sequences #320

Open
tirkarthi opened this issue Jul 20, 2020 · 1 comment
Open

Deprecation warning due to invalid escape sequences #320

tirkarthi opened this issue Jul 20, 2020 · 1 comment

Comments

@tirkarthi
Copy link

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' | grep -Ev 'vendor|example|doc|tools|sphinx' | xargs -P4 -I{} python3.8 -Wall -m py_compile {}
./smtLayer/getVM.py:306: DeprecationWarning: invalid escape sequence \*
  results['response'] = re.sub('\*DVHOPT.*', '', results['response'])
./smtLayer/getVM.py:334: DeprecationWarning: invalid escape sequence \*
  results['response'] = re.sub('\*DVHOPT.*', '', results['response'])
./smtLayer/vmUtils.py:152: DeprecationWarning: invalid escape sequence \.
  match = re.search('Reason code (.+?)\.', output)
./smtLayer/vmUtils.py:814: DeprecationWarning: invalid escape sequence \w
  search_pattern = '(^HCP\w\w\w045E|^HCP\w\w\w361E)'.encode()
./smtLayer/vmUtils.py:1123: DeprecationWarning: invalid escape sequence \w
  match = re.search('(^HCP\w\w\w045E|^HCP\w\w\w361E)', out)
./smtLayer/changeVM.py:889: DeprecationWarning: invalid escape sequence \w
  if re.search('(^HCP\w\w\w040E)', results['response']):
./zvmsdk/utils.py:232: DeprecationWarning: invalid escape sequence \s
  if re.search('\s', cidr):
./zvmsdk/utils.py:555: DeprecationWarning: invalid escape sequence \w
  strfail = '(^HCP\w\w\w003E|^HCP\w\w\w040E|' + \
./zvmsdk/utils.py:556: DeprecationWarning: invalid escape sequence \w
  '^HCP\w\w\w026E|^HCP\w\w\w045E)'
./zvmsdk/utils.py:559: DeprecationWarning: invalid escape sequence \w
  strfail = '(^HCP\w\w\w003E|^HCP\w\w\w040E|^HCP\w\w\w026E)'
./zvmsdk/utils.py:560: DeprecationWarning: invalid escape sequence \w
  strok = '(^%s|^HCP\w\w\w045E|^HCP\w\w\w361E)' % userid
./zvmsdk/sdkwsgi/validation/parameter_types.py:188: DeprecationWarning: invalid escape sequence \s
  'pattern': '^([0-9a-fA-F]{,4})(\s+[0-9a-fA-F]{,4}){,2}$'}
./zvmsdk/sdkwsgi/validation/parameter_types.py:235: DeprecationWarning: invalid escape sequence \w
  'pattern': '^https?:/{2}|^file:/{3}\w.+$'
./zvmsdk/sdkwsgi/validation/parameter_types.py:247: DeprecationWarning: invalid escape sequence \-
  'pattern': '^[a-zA-Z0-9\-]+\@([0-9]{1,3}(.[0-9]{1,3}){3}$|'
./zvmsdk/sdkwsgi/validation/parameter_types.py:248: DeprecationWarning: invalid escape sequence \-
  '[a-zA-Z0-9\-]+(.[a-zA-Z0-9\-]){1,}$)'
./zvmsdk/sdkwsgi/validation/parameter_types.py:256: DeprecationWarning: invalid escape sequence \w
  'pattern': '^(\w{,8})$'
./zvmsdk/sdkwsgi/validation/parameter_types.py:268: DeprecationWarning: invalid escape sequence \*
  {'pattern': '\*'},
./zvmsdk/sdkwsgi/validation/parameter_types.py:288: DeprecationWarning: invalid escape sequence \s
  'pattern': '^(\s*\w{1,8}\s*)(,\s*\w{1,8}\s*){0,}$'
./zvmsdk/sdkwsgi/validation/parameter_types.py:295: DeprecationWarning: invalid escape sequence \s
  'pattern': '^(\s*\w{1,8}\s*)(,\s*\w{1,8}\s*){0,}$'
./zvmsdk/sdkwsgi/validation/parameter_types.py:308: DeprecationWarning: invalid escape sequence \w
  'pattern': '^\w+:\w+$'
./zvmsdk/sdkwsgi/validation/parameter_types.py:315: DeprecationWarning: invalid escape sequence \w
  'pattern': '^\w+:\w+$',
./zvmsdk/sdkwsgi/validation/parameter_types.py:329: DeprecationWarning: invalid escape sequence \w
  'disk_pool': {'type': 'string', 'pattern': '^\w+:\w+$'}
./zvmsdk/tests/fvt/test_suites.py:33: DeprecationWarning: invalid escape sequence \W
  re.sub('\W', '_',
./zvmsdk/tests/fvt/test_utils.py:522: DeprecationWarning: invalid escape sequence \w
  if re.search('(^HCP\w\w\w003E)', output):
@jichenjc
Copy link
Collaborator

@tirkarthi thanks a lot for your help ,we will check this
@bjhuangr FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants