Some docstrings in cw 0.1.4 (the PyPI release and the current source) are not raw strings but contain reST escapes such as Sequence\ s. Python 3.12 prints SyntaxWarning: invalid escape sequence '\ ' the first time the module is compiled (a fresh virtualenv, or no cached bytecode). With warnings treated as errors (python -W error, pytest -W error::SyntaxWarning), compiling the module is a SyntaxError.
Modules that do not compile with SyntaxWarning as an error:
cw/grammar.py line 482: invalid escape sequence '\ '
Why it matters
Every consumer's first command prints the warning. Found while verifying a clean PyPI install of acquaint 0.0.2 (thorwhalen/acquaint), which depends on cw: the first acquaint call in a new virtualenv prints it before its own output.
Fix
Make those docstrings raw (r"""…""") or double the backslashes. A test that compiles every module with SyntaxWarning as an error would keep it from coming back.
Some docstrings in cw 0.1.4 (the PyPI release and the current source) are not raw strings but contain reST escapes such as
Sequence\ s. Python 3.12 printsSyntaxWarning: invalid escape sequence '\ 'the first time the module is compiled (a fresh virtualenv, or no cached bytecode). With warnings treated as errors (python -W error,pytest -W error::SyntaxWarning), compiling the module is a SyntaxError.Modules that do not compile with
SyntaxWarningas an error:cw/grammar.pyline 482: invalid escape sequence '\ 'Why it matters
Every consumer's first command prints the warning. Found while verifying a clean PyPI install of
acquaint0.0.2 (thorwhalen/acquaint), which depends on cw: the firstacquaintcall in a new virtualenv prints it before its own output.Fix
Make those docstrings raw (
r"""…""") or double the backslashes. A test that compiles every module withSyntaxWarningas an error would keep it from coming back.