Re: [PATCH v2] Fix invalid escape sequence warnings

From: Quentin Monnet
Date: Wed Aug 30 2023 - 14:34:14 EST


On 29/08/2023 08:49, Vishal Chourasia wrote:
> The script bpf_doc.py generates multiple SyntaxWarnings related to invalid
> escape sequences when executed with Python 3.12. These warnings do not appear in
> Python 3.10 and 3.11 and do not affect the kernel build, which completes
> successfully.
>
> This patch resolves these SyntaxWarnings by converting the relevant string
> literals to raw strings or by escaping backslashes. This ensures that
> backslashes are interpreted as literal characters, eliminating the warnings.
>
> Signed-off-by: Vishal Chourasia <vishalc@xxxxxxxxxxxxx>
> Reported-by: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx>

Thanks! I observed that this patch fixes warnings reported by pyright in
my editor. I've also validated that the generated files (helpers man
page, syscall man page, bpf_helper_defs.h) remain unchanged.

Tested-by: Quentin Monnet <quentin@xxxxxxxxxxxxx>