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 in Python 3.8 #352

Open
tirkarthi opened this issue Feb 7, 2020 · 2 comments
Open

Comments

@tirkarthi
Copy link
Contributor

Deprecation warnings are emitted in Python 3.8 for invalid escape sequences. Escaping them or using raw strings will fix this issue.

find . -iname '*.py'  | xargs -P 4 -I{} python3.8 -Wall -m py_compile {}                               
./test/test_samplefile.py:41: DeprecationWarning: invalid escape sequence \s
  offset = len(re.compile('(\s*)').match(lines[0]).group())
./test/test_samplefile.py:43: DeprecationWarning: invalid escape sequence \w
  '[\w:]+)\])?(\s+linked to (?P<link>[\w/]+))?')
./odml/rdf/query_creator.py:91: DeprecationWarning: invalid escape sequence \(
  doc_pattern = re.compile("(doc|document)\(.*?\)")
./odml/rdf/query_creator.py:96: DeprecationWarning: invalid escape sequence \(
  sec_pattern = re.compile("(sec|section)\(.*?\)")
./odml/rdf/query_creator.py:101: DeprecationWarning: invalid escape sequence \(
  prop_pattern = re.compile("(prop|property)\(.*?\)")
./odml/rdf/query_creator.py:107: DeprecationWarning: invalid escape sequence \(
  p = re.compile("[\(|, ](id|author|date|version|repository|sections)[\)|,]")
./odml/rdf/query_creator.py:112: DeprecationWarning: invalid escape sequence \(
  p = re.compile("[\(|, ](id|name|definition|type|repository|reference|sections|properties)[\)|,]")
./odml/rdf/query_creator.py:117: DeprecationWarning: invalid escape sequence \(
  p = re.compile("[\(|, ](id|name|definition|dtype|unit|uncertainty|reference|value_origin)[\)|,]")
./odml/rdf/query_creator.py:153: DeprecationWarning: invalid escape sequence \(
  doc_pattern = re.compile("(doc|document)\(.*?\)")
./odml/rdf/query_creator.py:158: DeprecationWarning: invalid escape sequence \(
  sec_pattern = re.compile("(sec|section)\(.*?\)")
./odml/rdf/query_creator.py:163: DeprecationWarning: invalid escape sequence \(
  prop_pattern = re.compile("(prop|property)\(.*?\)")
./odml/rdf/query_creator.py:171: DeprecationWarning: invalid escape sequence \(
  p = re.compile("[, |\(](id|author|date|version|repository|sections):(.*?)[,|\)]")
./odml/rdf/query_creator.py:176: DeprecationWarning: invalid escape sequence \(
  p = re.compile("[, |\(](id|name|definition|type|repository|reference|sections|properties):(.*?)[,|\)]")
./odml/rdf/query_creator.py:181: DeprecationWarning: invalid escape sequence \(
  p = re.compile("[, |\(](id|name|definition|dtype|unit|uncertainty|reference|value_origin):(.*?)[,|\)]")
./odml/rdf/query_creator.py:185: DeprecationWarning: invalid escape sequence \[
  p_value = re.compile("value:\[(.*)]")
@mpsonntag
Copy link
Contributor

PR #355 should address this issue. A follow up PR will further cleanup all Deprecation warnings we'll find.

@mpsonntag
Copy link
Contributor

PR #356 should have cleaned up the remaining Deprecation warnings. Please let me know if I missed any.

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