ipython-contrib / jupyter_contrib_nbextensions

A collection of various notebook extensions for Jupyter
http://jupyter-contrib-nbextensions.readthedocs.io/en/latest
Other
5.22k stars 806 forks source link

Deprecation warnings over invalid escape sequences in Python 3.7 #1497

Open tirkarthi opened 4 years ago

tirkarthi commented 4 years ago

Deprecation warning are generated over invalid escape sequences. This can be fixed by using raw strings or escaping the literals again.

find . -iname '*.py'  | xargs -P 4 -I{} python -Walways -m py_compile {}

./src/jupyter_contrib_nbextensions/nbconvert_support/pre_svg2pdf.py:195: DeprecationWarning: invalid escape sequence \[
  '\[(.*)\]\((.+).svg\)', self.replfunc, cell.source,
./src/jupyter_contrib_nbextensions/nbconvert_support/pre_embedimages.py:154: DeprecationWarning: invalid escape sequence \[
  regex = re.compile('!\[([^"]*)\]\(([^"]+)\)')
./src/jupyter_contrib_nbextensions/nbconvert_support/pp_highlighter.py:102: DeprecationWarning: invalid escape sequence \S
  "^<div class=\"(mark|burk|girk)\">([\S\s]*?)<\/div>" +
./src/jupyter_contrib_nbextensions/nbconvert_support/pp_highlighter.py:106: DeprecationWarning: invalid escape sequence \S
  "<span class=\"(mark|burk|girk)\">([\S\s]*?)<\/span>",
./src/jupyter_contrib_nbextensions/nbconvert_support/pp_highlighter.py:112: DeprecationWarning: invalid escape sequence \S
  "^<div class=\"(mark|burk|girk)\">([\S\s]*?)<\/div>" +
./src/jupyter_contrib_nbextensions/nbconvert_support/pp_highlighter.py:116: DeprecationWarning: invalid escape sequence \S
  "<span class=\"(mark|burk|girk)\">([\S\s]*?)<\/span>",