Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: use raw strings for the regex escapes in the knowledge filesystem - #29515

Merged
tjbck merged 1 commit into
open-webui:devfrom
Classic298:fix/knowledge-fs-escape-sequences
Sep 3, 2026
Merged

fix: use raw strings for the regex escapes in the knowledge filesystem#29515
tjbck merged 1 commit into
open-webui:devfrom
Classic298:fix/knowledge-fs-escape-sequences

Conversation

@Classic298

Copy link
Copy Markdown
Member

The regex detection helpers wrote their backslash escapes in ordinary string literals, so Python reported six invalid escape sequences on import. They work today because Python leaves an unrecognised escape as its two characters, but that behaviour is deprecated and becomes a syntax error in a future release, at which point the knowledge filesystem tools stop importing at all.

The literals are now raw, which is the same two characters with no warning. Pattern detection and normalisation are unchanged: verified identical output over every string up to length five drawn from the characters these helpers look at.

Contributor License Agreement

The regex detection helpers wrote their backslash escapes in ordinary string
literals, so Python reported six invalid escape sequences on import. They work
today because Python leaves an unrecognised escape as its two characters, but
that behaviour is deprecated and becomes a syntax error in a future release, at
which point the knowledge filesystem tools stop importing at all.

The literals are now raw, which is the same two characters with no warning.
Pattern detection and normalisation are unchanged: verified identical output
over every string up to length five drawn from the characters these helpers
look at.
@tjbck
tjbck merged commit 8600b05 into open-webui:dev Sep 3, 2026
2 checks passed
@Classic298
Classic298 deleted the fix/knowledge-fs-escape-sequences branch September 3, 2026 19:01
pujitha24 pushed a commit to pujitha24/open-webui that referenced this pull request Sep 5, 2026
open-webui#29515)

The regex detection helpers wrote their backslash escapes in ordinary string
literals, so Python reported six invalid escape sequences on import. They work
today because Python leaves an unrecognised escape as its two characters, but
that behaviour is deprecated and becomes a syntax error in a future release, at
which point the knowledge filesystem tools stop importing at all.

The literals are now raw, which is the same two characters with no warning.
Pattern detection and normalisation are unchanged: verified identical output
over every string up to length five drawn from the characters these helpers
look at.
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