Skip to content

Fix unwanted escaping of regex string-constants (SyntaxWarning: invalid escape sequence)#69

Open
umgfoin wants to merge 1 commit into
grommunio:masterfrom
umgfoin:PR_fix_a01501e
Open

Fix unwanted escaping of regex string-constants (SyntaxWarning: invalid escape sequence)#69
umgfoin wants to merge 1 commit into
grommunio:masterfrom
umgfoin:PR_fix_a01501e

Conversation

@umgfoin
Copy link
Copy Markdown
Contributor

@umgfoin umgfoin commented May 21, 2026

Regex-constants like "\_" should not be escaped - assign them as raw-string literals.
"\_" -> r"\_"
Fixes commit a01501e causing
endpoints/__init__.py:388: SyntaxWarning: invalid escape sequence '\_'
and related.

"\_" -> r"\_"
Fixes commit a01501e.

Signed-off-by: umgfoin <umgfoin@users.noreply.github.com>
@crpb
Copy link
Copy Markdown
Contributor

crpb commented May 27, 2026

I guess this fixes this so no need for another issue \ö/.

root@grom-deb:~# apt dist-upgrade
Upgrading:
  grommunio-admin-api

Summary:
  Upgrading: 1, Installing: 0, Removing: 0, Not Upgrading: 0
  Download size: 209 kB
  Space needed: 0 B / 11.7 GB available

Continue? [Y/n]
Get:1 https://download.grommunio.com/community/Debian_13 Debian_13/main amd64 grommunio-admin-api all 1.19.6.m37abcff-1+1.1 [209 kB]
Fetched 209 kB in 0s (931 kB/s)
[master a488c06] saving uncommitted changes in /etc prior to apt run
 4 files changed, 1 insertion(+), 6 deletions(-)
 delete mode 120000 systemd/system/multi-user.target.wants/gromox-istore.service
Reading changelogs... Done
(Reading database ... 76687 files and directories currently installed.)
Preparing to unpack .../grommunio-admin-api_1.19.6.m37abcff-1+1.1_all.deb ...
Unpacking grommunio-admin-api (1.19.6.m37abcff-1+1.1) over (1.18.28.m37abcff-1+18.1) ...
Setting up grommunio-admin-api (1.19.6.m37abcff-1+1.1) ...
/usr/share/grommunio-admin-api/cli/common.py:24: SyntaxWarning: invalid escape sequence '\_'
  Users.username.ilike(userSpec.replace("_", "\_")+("%" if autocompleting else "")), *filters)
/usr/share/grommunio-admin-api/endpoints/__init__.py:388: SyntaxWarning: invalid escape sequence '\_'
  matchexpr = tuple("%"+substr.replace("_", "\_")+"%" for substr in expr.split())
/usr/share/grommunio-admin-api/tools/DataModel.py:580: SyntaxWarning: invalid escape sequence '\_'
  matchexpr = tuple("%"+substr.replace("_", "\_")+"%" for substr in expr.split())
Processing triggers for man-db (2.13.1-1) ...
Scanning processes...
Scanning linux images...

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.

@jengelh jengelh requested a review from grammmike May 27, 2026 05:28
@StefanAkie
Copy link
Copy Markdown
Member

lgtm

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.

3 participants