Skip to content

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

@benoit9126

Description

@benoit9126

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions