whatmp3
whatmp3 copied to clipboard
Convert string literal to regex
When attempting to run whatmp3 with python 3.12, I received the errors
/usr/bin/whatmp3:239: SyntaxWarning: invalid escape sequence '\S' t = re.sub('\S.+?=', '', os.popen(tagcmd).read().rstrip(), count=1) /usr/bin/whatmp3:249: SyntaxWarning: invalid escape sequence '.' outname = re.sub(re.compile('.flac$', re.IGNORECASE), '', outname)
The regular expressions were represented using string literals and so the escape sequences were invalid. Converting the strings to regex fixes this issue.