Skip to content

SyntaxWarning invalid escape sequence #483

@DavidMertz

Description

@DavidMertz

When launching a project the indirectly utilizes geocoder I get a SyntaxWarning on Python 3.12:

/home/.../.venv/lib/python3.12/site-packages/geocoder/uscensus.py:36: SyntaxWarning: invalid escape sequence '\d'
  match = re.search('^\d+', self.address, re.UNICODE)

It looks like your library is pulled in by usaddress-scourgify, version = "0.6.0". From uv.lock I see:

name = "geocoder"
version = "1.38.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
    { name = "click" },
    { name = "future" },
    { name = "ratelim" },
    { name = "requests" },
    { name = "six" },
]
sdist = { url = "https://files.pythonhosted.org/packages/ea/0b/2ea440270c1efb7ac73450cb704344c8127f45dabff0bea48711dc9dd93a/geocoder-1.38.1.tar.gz", hash = "sha256:c9925374c961577d0aee403b09e6f8ea1971d913f011f00ca70c76beaf7a77e7", size = 64345 }
wheels = [
    { url = "https://files.pythonhosted.org/packages/4f/6b/13166c909ad2f2d76b929a4227c952630ebaf0d729f6317eb09cbceccbab/geocoder-1.38.1-py2.py3-none-any.whl", hash = "sha256:a733e1dfbce3f4e1a526cac03aadcedb8ed1239cf55bd7f3a23c60075121a834", size = 98590 },
]

The fix looks like it's a straightforward change to r'^\d+' rather than a plain non-rstring quote. I can submit a PR if that helps, but it's literally a one-character change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions