CybOXProject / python-cybox

A Python library for parsing, manipulating, and generating CybOX content.
http://cybox.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
77 stars 42 forks source link

Deprecation warning due to invalid escape sequences #331

Closed tirkarthi closed 4 years ago

tirkarthi commented 4 years ago

Deprecation warning due to invalid escape sequences. Using raw strings or escaping them again helps in resolving this. Check https://github.com/asottile/pyupgrade/ for automatic fix of this.

find . -iname '*.py' | grep -Ev 'rdf4|tool|doc' | xargs -P4 -I{} python3.8 -Wall -m py_compile {}
./cybox/utils/normalize.py:40: DeprecationWarning: invalid escape sequence \w
  {'regex' : re.compile('[\w][:]\\\\windows\\\\system32',flags=re.IGNORECASE),
./cybox/utils/normalize.py:42: DeprecationWarning: invalid escape sequence \w
  {'regex' : re.compile('[\w][:]\\\\windows(?:(?!\\\\system32))',flags=re.IGNORECASE),
./cybox/utils/normalize.py:44: DeprecationWarning: invalid escape sequence \w
  {'regex' : re.compile('[\w][:]\\\\[A-Z+a-z~ ()0-9\\\\]+\\\\application data',flags=re.IGNORECASE),
./cybox/utils/normalize.py:46: DeprecationWarning: invalid escape sequence \w
  {'regex' : re.compile('[\w][:]\\\\[A-Z+a-z~ ()0-9\\\\]+\\\\all users\\\\application data',flags=re.IGNORECASE),
./cybox/utils/normalize.py:48: DeprecationWarning: invalid escape sequence \w
  {'regex' : re.compile('[\w][:]\\\\[A-Z+a-z~ ()0-9\\\\]+\\\\all users\\\\start menu\\\\programs',flags=re.IGNORECASE),
./cybox/utils/normalize.py:50: DeprecationWarning: invalid escape sequence \w
  {'regex' : re.compile('[\w][:]\\\\[A-Z+a-z~ ()0-9\\\\]+\\\\temp',flags=re.IGNORECASE),
./cybox/utils/normalize.py:52: DeprecationWarning: invalid escape sequence \w
  {'regex' : re.compile('[\w][:]\\\\users\\\\[A-Z+a-z~ ()0-9]+',flags=re.IGNORECASE),
./cybox/utils/normalize.py:54: DeprecationWarning: invalid escape sequence \w
  {'regex' : re.compile('^\w:\\\\{0,2}$',flags=re.IGNORECASE),
./cybox/utils/normalize.py:56: DeprecationWarning: invalid escape sequence \w
  {'regex' : re.compile('^\w:\\\\documents and settings\\\\all users',flags=re.IGNORECASE),
./cybox/utils/normalize.py:58: DeprecationWarning: invalid escape sequence \w
  {'regex' : re.compile('^\w:\\\\programdata',flags=re.IGNORECASE),
./cybox/test/objects/win_service_test.py:41: DeprecationWarning: invalid escape sequence \W
  'startup_command_line': u('C:\WINDOWS\system32\svchost.exe -k wsappx -p'),
./cybox/test/utils/normalize_test.py:52: DeprecationWarning: invalid escape sequence \W
  file_path_string = "C:\Windows\System32\abcd.dll"
./examples/simple_file_instance.py:19: DeprecationWarning: invalid escape sequence \M
  f.file_path = "AppData\Mozilla"