Skip to content

Fix SyntaxWarning for invalid escape sequence in regex#1063

Open
nafg wants to merge 1 commit into
boltgolt:masterfrom
nafg:fix/regex-warning
Open

Fix SyntaxWarning for invalid escape sequence in regex#1063
nafg wants to merge 1 commit into
boltgolt:masterfrom
nafg:fix/regex-warning

Conversation

@nafg
Copy link
Copy Markdown

@nafg nafg commented Nov 20, 2025

Use raw string (r'...') for regex pattern to avoid SyntaxWarning about invalid escape sequences like \w. This warning will become an error in future Python versions.

(I used Claude Code for this)

Use raw string (r'...') for regex pattern to avoid SyntaxWarning about
invalid escape sequences like \w. This warning will become an error in
future Python versions.
@nafg
Copy link
Copy Markdown
Author

nafg commented Nov 20, 2025

(I encountered the warning after enabling the nod rubber stamp)

Copy link
Copy Markdown

@giggio giggio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested it on NixOS 26.05. I also had the issue with rubberstamps. The patch fixed it.
For anyone else on NixOS, add this to your config:

{
  services = {
    howdy = {
      package = pkgs.howdy.overrideAttrs (old: {
        patches = (old.patches or [ ]) ++ [
          (pkgs.fetchpatch {
            url = "https://patch-diff.githubusercontent.com/raw/boltgolt/howdy/pull/1063.patch"; # fix regex issue on rubberstamps
            sha256 = "sha256-NkFcMW6VIs8uKz9A0+SFzZbjntQVOxZGwD9wyeiZ6dc=";
          })
        ];
      });
    };
  };
}

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants