ghapi icon indicating copy to clipboard operation
ghapi copied to clipboard

SyntaxWarning: invalid escape sequence

Open koliyo opened this issue 1 year ago • 2 comments

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*$')

koliyo avatar Dec 19 '23 10:12 koliyo

+1 Same here with Python 3.12

samoilovartem avatar Dec 28 '23 02:12 samoilovartem

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")

mohitmishra786 avatar Apr 07 '24 17:04 mohitmishra786