Skip to content

Comments

Convert string literal to regex#43

Merged
RecursiveForest merged 1 commit intoRecursiveForest:masterfrom
erichlf:invalid_escape_sequence
Jan 15, 2025
Merged

Convert string literal to regex#43
RecursiveForest merged 1 commit intoRecursiveForest:masterfrom
erichlf:invalid_escape_sequence

Conversation

@erichlf
Copy link
Contributor

@erichlf erichlf commented Sep 21, 2024

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.

The regular expressions were represented using string literals and so
the escape sequences were invalid. Converting the strings to regex fixes
this issue.
@RecursiveForest RecursiveForest merged commit cf3d8de into RecursiveForest:master Jan 15, 2025
@RecursiveForest
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants