From b1a5d92b65981736c2d1f786ed54b74b263fe5d4 Mon Sep 17 00:00:00 2001 From: Mehdi Boutayeb Date: Mon, 14 Sep 2026 13:05:13 +0200 Subject: [PATCH] Fix invalid escape sequences in holecircle and plasmac2 nc_files/holecircle.py (`\.`) and configs/sim/axis/plasma/plasmac2/plasmac2.py (`\O`) use invalid escape sequences in non-raw string literals, which raise `SyntaxWarning: invalid escape sequence` on Python 3.12+. Escaping the backslashes keeps each string value identical (ruff W605-style). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_014HBQNzAf5C2E3MiJC48HQw --- configs/sim/axis/plasma/plasmac2/plasmac2.py | 2 +- nc_files/holecircle.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/sim/axis/plasma/plasmac2/plasmac2.py b/configs/sim/axis/plasma/plasmac2/plasmac2.py index f9a71b2271b..bc35db04737 100644 --- a/configs/sim/axis/plasma/plasmac2/plasmac2.py +++ b/configs/sim/axis/plasma/plasmac2/plasmac2.py @@ -2498,7 +2498,7 @@ def user_button_setup(): elif bCode.strip() == 'cut-type' and not 'cut-type' in buttonCodes: bName = bName.split(',') if len(bName) == 1: - text = _('Pierce\Only') if '\\' in bName[0] else _('Pierce Only') + text = _('Pierce\\Only') if '\\' in bName[0] else _('Pierce Only') bName.append(text) outCode = {'code':'cut-type', 'text':bName} elif bCode.strip() == 'single-cut' and not 'single-cut' in buttonCodes: diff --git a/nc_files/holecircle.py b/nc_files/holecircle.py index 2dabca89509..88023a3c8b5 100644 --- a/nc_files/holecircle.py +++ b/nc_files/holecircle.py @@ -27,9 +27,9 @@ def ui(): f.grid(row=0, column=1, sticky="nw") b.grid(row=1, column=0, columnspan=2, sticky="ne") - validate_float = "expr {[regexp {^-?([0-9]+(\.[0-9]*)?|\.[0-9]+|)$} %P]}" + validate_float = "expr {[regexp {^-?([0-9]+(\\.[0-9]*)?|\\.[0-9]+|)$} %P]}" validate_int = "expr {[regexp {^-?([0-9]+|)$} %P]}" - validate_posfloat = "expr {[regexp {^?([0-9]+(\.[0-9]*)?|\.[0-9]+|)$} %P]}" + validate_posfloat = "expr {[regexp {^?([0-9]+(\\.[0-9]*)?|\\.[0-9]+|)$} %P]}" validate_posint = "expr {[regexp {^([0-9]+|)$} %P]}" def posfloatentry(f, v): var = tkinter.DoubleVar(f)