An unrecognised escape sequence in a regular string literal, such as \d in "\d+", was a DeprecationWarning through Python 3.11 and became a SyntaxWarning in 3.12 (October 2023). DeprecationWarning is hidden by default outside __main__; SyntaxWarning is shown by default, so upgrading to 3.12 makes previously silent code start printing SyntaxWarning: invalid escape sequence '\d' at import or compile time.
The warning fires when the module is compiled, so it can appear once and then never again while a __pycache__ entry is fresh. Clear the cache or run with python -B to see it reliably, and use -W error::SyntaxWarning to turn every occurrence into a failure you can locate.
The fix is a raw string, r"\d+", for regexes and Windows paths, or doubling the backslash where a literal backslash is meant. This is worth doing now rather than later: the documented plan is for these to become a SyntaxError in a future release, at which point the same code fails to import at all.