python:S1717 "\" should only be used as an escape character outside of raw strings

Hello.

Problematic rule is "" should only be used as an escape character outside of raw strings. In code view it says ‘Remove this “\”, add another “\” to escape it, or make this a raw string.’.

SonarQube
Version: 10.3.0.82913
Date: 2022-10-17

Code looks like this:

pattern = rf"(?:\.(?![-_])[{alphanum_w_unicode}_-]{{1,63}}(?<![-_]))*"

It seems like Sonar doesn’t recognize that this is a raw string with r" because f is between these characters.

Hey there.

Thanks for the report! This is already being tracked here. I’ll link your thread. :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.