<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From 0c0a392d319ed495a55f8ad29291c4a7cbd5077a Mon Sep 17 00:00:00 2001
From: sblondon &lt;stephane.blondon@gmail.com&gt;
Date: Tue, 19 Mar 2024 19:33:17 +0100
Subject: [PATCH] Fix syntax warnings in Python3.12 (#17)

Python3.12 added new syntax warning if strings contain invalid sequence.

The change is documented in:
https://docs.python.org/3/whatsnew/3.12.html#other-language-changes
---
 bin/hatop | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/bin/hatop b/bin/hatop
index bb69311..9aa9553 100755
--- a/bin/hatop
+++ b/bin/hatop
@@ -196,7 +196,7 @@ HAPROXY_CLI_MAXLINES = 1000
 CLI_MAXLINES = 1000
 CLI_MAXHIST = 100
 CLI_INPUT_LIMIT = 200
-CLI_INPUT_RE = re.compile('[a-zA-Z0-9_:\.\-\+; /#%]')
+CLI_INPUT_RE = re.compile(r'[a-zA-Z0-9_:\.\-\+; /#%]')
 CLI_INPUT_DENY_CMD = ['prompt', 'set timeout cli', 'quit']
 
 # Note: Only the last 3 lines are visible instantly on 80x25
@@ -214,20 +214,20 @@ SCREEN_YMAX = 100
 SCREEN_HPOS = 11
 
 HAPROXY_INFO_RE = {
-'software_name':    re.compile('^Name:\s*(?P&lt;value&gt;\S+)'),
-'software_version': re.compile('^Version:\s*(?P&lt;value&gt;\S+)'),
-'software_release': re.compile('^Release_date:\s*(?P&lt;value&gt;\S+)'),
-'nproc':            re.compile('^Nbproc:\s*(?P&lt;value&gt;\d+)'),
-'procn':            re.compile('^Process_num:\s*(?P&lt;value&gt;\d+)'),
-'pid':              re.compile('^Pid:\s*(?P&lt;value&gt;\d+)'),
-'uptime':           re.compile('^Uptime:\s*(?P&lt;value&gt;[\S ]+)$'),
-'maxconn':          re.compile('^Maxconn:\s*(?P&lt;value&gt;\d+)'),
-'curconn':          re.compile('^CurrConns:\s*(?P&lt;value&gt;\d+)'),
-'maxpipes':         re.compile('^Maxpipes:\s*(?P&lt;value&gt;\d+)'),
-'curpipes':         re.compile('^PipesUsed:\s*(?P&lt;value&gt;\d+)'),
-'tasks':            re.compile('^Tasks:\s*(?P&lt;value&gt;\d+)'),
-'runqueue':         re.compile('^Run_queue:\s*(?P&lt;value&gt;\d+)'),
-'node':             re.compile('^node:\s*(?P&lt;value&gt;\S+)'),
+'software_name':    re.compile(r'^Name:\s*(?P&lt;value&gt;\S+)'),
+'software_version': re.compile(r'^Version:\s*(?P&lt;value&gt;\S+)'),
+'software_release': re.compile(r'^Release_date:\s*(?P&lt;value&gt;\S+)'),
+'nproc':            re.compile(r'^Nbproc:\s*(?P&lt;value&gt;\d+)'),
+'procn':            re.compile(r'^Process_num:\s*(?P&lt;value&gt;\d+)'),
+'pid':              re.compile(r'^Pid:\s*(?P&lt;value&gt;\d+)'),
+'uptime':           re.compile(r'^Uptime:\s*(?P&lt;value&gt;[\S ]+)$'),
+'maxconn':          re.compile(r'^Maxconn:\s*(?P&lt;value&gt;\d+)'),
+'curconn':          re.compile(r'^CurrConns:\s*(?P&lt;value&gt;\d+)'),
+'maxpipes':         re.compile(r'^Maxpipes:\s*(?P&lt;value&gt;\d+)'),
+'curpipes':         re.compile(r'^PipesUsed:\s*(?P&lt;value&gt;\d+)'),
+'tasks':            re.compile(r'^Tasks:\s*(?P&lt;value&gt;\d+)'),
+'runqueue':         re.compile(r'^Run_queue:\s*(?P&lt;value&gt;\d+)'),
+'node':             re.compile(r'^node:\s*(?P&lt;value&gt;\S+)'),
 }
 
 HAPROXY_STAT_MAX_SERVICES = 1000
@@ -236,9 +236,9 @@ Warning: You have reached the stat parser limit! (%d)
 Use --filter to parse specific service stats only.
 ''' % HAPROXY_STAT_MAX_SERVICES
 HAPROXY_STAT_FILTER_RE = re.compile(
-        '^(?P&lt;iid&gt;-?\d+)\s+(?P&lt;type&gt;-?\d+)\s+(?P&lt;sid&gt;-?\d+)$')
+        r'^(?P&lt;iid&gt;-?\d+)\s+(?P&lt;type&gt;-?\d+)\s+(?P&lt;sid&gt;-?\d+)$')
 HAPROXY_STAT_PROXY_FILTER_RE = re.compile(
-        '^(?P&lt;pxname&gt;[a-zA-Z0-9_:\.\-]+)$')
+        r'^(?P&lt;pxname&gt;[a-zA-Z0-9_:\.\-]+)$')
 HAPROXY_STAT_COMMENT = '#'
 HAPROXY_STAT_SEP = ','
 HAPROXY_STAT_CSV = [
</pre></body></html>