Skip to content

Invalid escape sequence in RegEx pattern #133

@2bndy5

Description

@2bndy5

version_str = re.search("([0-9]\.*)*[0-9]", version_str).group(0)

/home/runner/.cache/uv/archive-v0/gQVN497zrc49u5GmIxX_f/lib/python3.14/site-packages/circuitpython_build_tools/build.py:46: SyntaxWarning: "." is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\."? A raw string is also an option.

I think the solution is to make it a raw string:

-    version_str = re.search("([0-9]\.*)*[0-9]", version_str).group(0)
+    version_str = re.search(r"([0-9]\.*)*[0-9]", version_str).group(0)

Otherwise, the escape char has to be escaped as well (\\.).


PS - Would it hurt to upload a bdist wheel to PyPI? I only got this warning because uv had to build this package from the source dist on PyPI (there are no bdist wheels available on PyPI).

run: |
python setup.py sdist
twine upload dist/*

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