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 because of "\S" in Python 3.12 #9

Closed
benoit9126 opened this issue Nov 9, 2023 · 2 comments · Fixed by #10
Closed

Syntax warning because of "\S" in Python 3.12 #9

benoit9126 opened this issue Nov 9, 2023 · 2 comments · Fixed by #10

Comments

@benoit9126
Copy link
Contributor

Hi!

When I import your package using Python 3.12, a syntax warning is emitted.

>>> import machineid
/home/user/.pyenv/versions/venv-name/lib/python3.12/site-packages/machineid/__init__.py:70: SyntaxWarning: invalid escape sequence '\S'
  id = __reg__('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography', 'MachineGuid')

This is related to this PR of CPython python/cpython#99011. Could it be possible to add a r before this string to avoid this warning (that will become a SyntaxError in future Python releases)

id = __reg__(r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography", "MachineGuid")
@ezekg
Copy link
Member

ezekg commented Nov 9, 2023

Would you be open to a PR?

@benoit9126
Copy link
Contributor Author

Sure!

@ezekg ezekg closed this as completed in #10 Nov 10, 2023
ezekg pushed a commit that referenced this issue Nov 10, 2023
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

Successfully merging a pull request may close this issue.

2 participants