AnswerDotAI / ghapi

A delightful and complete interface to GitHub's amazing API
https://ghapi.fast.ai/
Apache License 2.0
626 stars 65 forks source link

SyntaxWarning: invalid escape sequence #168

Open koliyo opened 11 months ago

koliyo commented 11 months ago

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*$')
samoilovartem commented 11 months ago

+1 Same here with Python 3.12

mohitmishra786 commented 7 months ago

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