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

Fixed error in regex that detects noindex directives, and bumped Python to 3.12 in CI/CD workflow when running unit tests #109

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

cicirello
Copy link
Owner

@cicirello cicirello commented Oct 5, 2023

Summary

Fixed a bug in the regular expression used to detect if a page has a meta robots noindex directive in the head. Bug related to \s* for detecting a sequence of 0 or more spaces possibly not being correctly passed to Python's regex processor. Python 3.12 gives a warning of an invalid escape sequence. Need to escape the slash so it is passed to regex processor, and not treated as an escape in the string. Curiously, earlier versions of Python don't warn about this. I haven't been able to create an example that demonstrates the bug, which suggests that a \s is being passed through to the regex processor as desired. But should fix this anyway, as future versions of Python may treat the invalid escape sequence differently.

Bump Python to 3.12 in CI/CD workflow when running unit tests, in preparation for bumping Python to 3.12 within the Docker container for the action.

Closing Issues

Closes #107
Closes #110

Types of changes

  • I have read the CONTRIBUTING document.
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvements to existing code, such as refactoring or optimizations (non-breaking)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@cicirello cicirello added github_actions Pull requests that update Github_actions code testing CI/CD labels Oct 5, 2023
@cicirello cicirello self-assigned this Oct 5, 2023
@cicirello cicirello added the bug Something isn't working label Oct 5, 2023
@cicirello cicirello changed the title Bump Python to 3.12 in CI/CD workflow when running unit tests Fixed error in regex that detects noindex directives, and bumped Python to 3.12 in CI/CD workflow when running unit tests Oct 5, 2023
@cicirello cicirello merged commit dcf0de7 into master Oct 5, 2023
3 checks passed
@cicirello cicirello deleted the bump-python branch October 5, 2023 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CI/CD github_actions Pull requests that update Github_actions code hacktoberfest-accepted testing
Projects
None yet
1 participant