Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Warning in /core/dom.py #415

Open
wmhchathuranga opened this issue Oct 8, 2024 · 0 comments
Open

Syntax Warning in /core/dom.py #415

wmhchathuranga opened this issue Oct 8, 2024 · 0 comments

Comments

@wmhchathuranga
Copy link

We have a syntax warning in /core/dom.py

Line 27
controlledVariables.add(re.search(r'[a-zA-Z$_][a-zA-Z0-9$_]+', part).group().replace('$', '\$'))

Line 36
controlledVariables.add(re.search(r'[a-zA-Z$_][a-zA-Z0-9$_]+', part).group().replace('$', '\$'))

triggers a syntax warning with invalid escape sequence '\$'

Screenshots
image

Fix
We need to replace the

Line 27 with
controlledVariables.add(re.search(r'[a-zA-Z$_][a-zA-Z0-9$_]+', part).group().replace('$', r'\$'))

and

Line 36 with
controlledVariables.add(re.search(r'[a-zA-Z$_][a-zA-Z0-9$_]+', part).group().replace('$', r'\$'))

we just need to ask python to take the Raw String by adding r\'$'

Environment:

  • OS: MacOS Sequoia 15.0.1
  • Python 3.12.7

Other comments
I really appreciate your contribution to the Field.

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

No branches or pull requests

1 participant