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

SPDX warnings in Regexp #16

Closed
SebastianSchildt opened this issue Jan 26, 2025 · 2 comments
Closed

SPDX warnings in Regexp #16

SebastianSchildt opened this issue Jan 26, 2025 · 2 comments

Comments

@SebastianSchildt
Copy link
Contributor

I noticed the code gives warnings on the pattern machers:

/home/runner/work/_actions/eclipse-kuksa/kuksa-actions/4/spdx//verify-spdx-headers:11: SyntaxWarning: invalid escape sequence '\s'
  SPDX = re.compile(f'SPDX-License-Identifier:\s+({SLUG.pattern})')
/home/runner/work/_actions/eclipse-kuksa/kuksa-actions/4/spdx//verify-spdx-headers:24: SyntaxWarning: invalid escape sequence '\s'
  pattern = f"^{init}\s*{SPDX.pattern}\s*{fini}\s*$"
/home/runner/work/_actions/eclipse-kuksa/kuksa-actions/4/spdx//verify-spdx-headers:24: SyntaxWarning: invalid escape sequence '\s'
  pattern = f"^{init}\s*{SPDX.pattern}\s*{fini}\s*$"
/home/runner/work/_actions/eclipse-kuksa/kuksa-actions/4/spdx//verify-spdx-headers:24: SyntaxWarning: invalid escape sequence '\s'
  pattern = f"^{init}\s*{SPDX.pattern}\s*{fini}\s*$"
1 will be accepted!

(see e.g. https://github.com/COVESA/Open1722/actions/runs/12976294699/job/36188380910?pr=76 )

Still seems to work, did not yet look deeper. @erikbosch Have you maybe seen this before? is it new? Expected? Bad?

@erikbosch
Copy link
Contributor

I assume this is related to the recent "auto-upgrade" to Ubuntu 24.04 when using ubuntu-latest (at the moment it seems to be a bit random if you get 22.04 or 24.04). That gives us Python 3.12 (or newer?) and a changed handling for escapes.

https://docs.python.org/dev/whatsnew/3.12.html#other-language-changes

I changed to using raw strings in #17. That seems to the trick

@SebastianSchildt
Copy link
Contributor Author

Fixed in #17

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

2 participants