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

fix: SyntaxWarning for Escape Characters in String Literals #4792

Conversation

ConduciveMocha
Copy link
Contributor

What type of PR is this?

  • bug
  • cleanup

What this PR does / why we need it:

Removes SyntaxWarning: invalid escape sequence messages during server start.

As of 3.12, putting escape characters in string literals will cause this warning. This primarily effects regular expressions, requiring them to be raw strings instead of normal string literals. This pull requests fixes the warnings raised by the punctuation regular expression in the SearchFilter class and the slug check within the update function of the RepositoryCookbooks class.

Which issue(s) this PR fixes:

Fixes #4775

Special notes for your reviewer:

First PR -- Please let me know if I'm not meeting any of the contribution standards.

Testing

  • Pytest had no failures
  • Logged the result of searching recipes on both mealie-next and my branch with the search string !@#$%^&*()_-+="'<>,.?/~ and verified that the translation on query_search.py ln:25 had the same result.

Couldn't figure how the branch of code for the RepositoryCookbooks change is executed so would appreciate any pointers.

@ConduciveMocha ConduciveMocha marked this pull request as draft December 30, 2024 07:04
@ConduciveMocha ConduciveMocha marked this pull request as ready for review December 30, 2024 07:06
Copy link
Collaborator

@michael-genson michael-genson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Couldn't figure how the branch of code for the RepositoryCookbooks change is executed

It only gets executed if a cookbook is created with a duplicate name, however this is covered in tests, so as long as they're passing no worries

@michael-genson michael-genson enabled auto-merge (squash) December 30, 2024 21:11
@michael-genson michael-genson merged commit 78ab232 into mealie-recipes:mealie-next Dec 30, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - SyntaxWarning in repository_cookbooks.py and query_search.py for mealie >= v2.4.0
2 participants