pyFDT icon indicating copy to clipboard operation
pyFDT copied to clipboard

"SyntaxWarning: invalid escape sequence '\\*'\n" in strip_comments

Open cygerior opened this issue 10 months ago • 0 comments
trafficstars

Python 3.12+ throws SyntaxWarning when detectig invalid sequence in regular expressions. in fdt/misc.py - line 66 :

def strip_comments(text): text = re.sub('//.?(\r\n?|\n)|/*.?*/', '\n', text, flags=re.S) return text

shall use r'..' instead of '...' and therefore be replaced by:

def strip_comments(text): text = re.sub(r'//.?(\r\n?|\n)|/*.?*/', '\n', text, flags=re.S) return text

cygerior avatar Dec 27 '24 17:12 cygerior