fastai/ghapi

SyntaxWarning: invalid escape sequence

koliyo opened this issue · 2 comments

koliyo commented

Getting these warnings with python 3.12

/Users/nils/Library/Caches/pypoetry/virtualenvs/vrex-cli-9LieaW4p-py3.12/lib/python3.12/site-packages/fastcore/script.py:32: SyntaxWarning: invalid escape sequence '\.'
  x = re.sub("(enum |class|function|__main__\.|\ at.*)", '', x)
/Users/nils/Library/Caches/pypoetry/virtualenvs/vrex-cli-9LieaW4p-py3.12/lib/python3.12/site-packages/fastcore/script.py:33: SyntaxWarning: invalid escape sequence '\ '
  x = re.sub("(<|>|'|\ )", '', x) # spl characters
/Users/nils/Library/Caches/pypoetry/virtualenvs/vrex-cli-9LieaW4p-py3.12/lib/python3.12/site-packages/fastcore/docments.py:62: SyntaxWarning: invalid escape sequence '\s'
  _clean_re = re.compile('^\s*#(.*)\s*$')

+1 Same here with Python 3.12

Hello @koliyo ,

Can you firstly check whether if you are using an updated version of the fastcore library. If the issue still persists please try using

import warnings
warnings.filterwarnings("ignore", category=SyntaxWarning, module="fastcore")