X2Go Bug report logs - #1629
python3 SyntaxWarning in several packages

Package: python-x2go; Maintainer for python-x2go is X2Go Developers <x2go-dev@lists.x2go.org>; Source for python-x2go is src:python-x2go.

Reported by: Chris King <chrisking7603@gmail.com>

Date: Mon, 22 Jul 2024 13:10:01 UTC

Severity: normal

Full log


Message #5 received at submit@bugs.x2go.org (full text, mbox, reply):

Received: (at submit) by bugs.x2go.org; 22 Jul 2024 13:06:40 +0000
From chrisking7603@gmail.com  Mon Jul 22 15:06:36 2024
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-2.0 required=3.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,SPF_HELO_NONE,
	URIBL_BLOCKED,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4
Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 9BA195DB59
	for <submit@bugs.x2go.org>; Mon, 22 Jul 2024 15:06:35 +0200 (CEST)
Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-396eb81a1cfso17203345ab.2
        for <submit@bugs.x2go.org>; Mon, 22 Jul 2024 06:06:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721653594; x=1722258394; darn=bugs.x2go.org;
        h=subject:from:to:content-language:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=UvYXxhsFsVntPsdgk9eQ2ckqePeCX9gv98qfsYsxXSQ=;
        b=GJrCTrPgc93JQeBzhmHH8kLTCM+ksnLU/BIiBpKX7dZPmvifC+GkaFxi2UA2G5YRE1
         okUO1eHEK3X4aFmq2ygDRXfwHhN9h2ZxFC1qlhzJJTMawyw2VjOJeCovjPrtczJFwOaN
         Ik/EdsNzb760/rT0rpIAbVWC0HEnN1TQgLQ8Ctsw9KkqUmTZTxc1+zcBpjzWocDLxyH6
         pPStoSmKLtLiubRT1Bmdb5vNEpElTUV4nEuoQvBQ1eVkR+k7O/hyXaQxRt2eBynD/pam
         jioH57L+bgRd1fj/AES78BKWsel5++eAKa60BWV8IOFRXBUdCm0NZMMoFUBczgm9BulV
         t1Sw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721653594; x=1722258394;
        h=subject:from:to:content-language:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=UvYXxhsFsVntPsdgk9eQ2ckqePeCX9gv98qfsYsxXSQ=;
        b=oZTdbRVnbIltPux22DyfopHEpsfXka0y9VG3I2/pfOEuJQMpd2yMHjBKNCz/p34UtS
         Q1HhvuQ1aanJSuAaoVeK+DAf/vYCsLOm3AdR+I53u5OG3swKQD9OalVaDCs99zwCOYBR
         LsGJtV26WQTu9udj+55QgHTstfY4eDK6zfN4EQW8WYrl1Y/Ql3+hX8DRapvOU5tOYh3g
         WvTGy9ZFYhxsecpZvq9+n/WxBFfVRMrFkz4v7xumrJIBJaTgOsN1Y98nImQSwk/h2NvK
         iVzffcGoRkv7Tit0yoahYWztnFs0ukbyU4Nc9Mp3L92JQLDDn3upwSXj/shaT+90kCvk
         sVag==
X-Gm-Message-State: AOJu0YxryHwpBbQAxg2HXIiaKZy39MIKqJUlnyjYpvUChQDUBGRfBVTz
	qRPOIya3r3LKqyU+7c7t4AUJdw8dGfMmfcWq1VeD7bjnLPK0MtnnCDh4hPGu
X-Google-Smtp-Source: AGHT+IHKuVg9e/9kczaUW+H0PH54ZfL4BDloWndAyUk6gPu3CRgX7W74XOoUjLxInyo7R50aU2bxKw==
X-Received: by 2002:a05:6e02:152c:b0:398:17c8:6bdf with SMTP id e9e14a558f8ab-3993ff70655mr97068355ab.8.1721653593328;
        Mon, 22 Jul 2024 06:06:33 -0700 (PDT)
Received: from ?IPV6:2001:44b8:218:f200:c7e6:e6bc:a3cd:7f23? (2001-44b8-0218-f200-c7e6-e6bc-a3cd-7f23.static.ipv6.internode.on.net. [2001:44b8:218:f200:c7e6:e6bc:a3cd:7f23])
        by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70d285943e3sm1692037b3a.213.2024.07.22.06.06.31
        for <submit@bugs.x2go.org>
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Mon, 22 Jul 2024 06:06:32 -0700 (PDT)
Content-Type: multipart/alternative;
 boundary="------------QnKYRYv7bO82uUvotrAXz0iC"
Message-ID: <ffd9e458-2410-47e7-9380-43fc0a4273a8@gmail.com>
Date: Mon, 22 Jul 2024 22:36:29 +0930
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: submit@bugs.x2go.org
From: Chris King <chrisking7603@gmail.com>
Subject: python3 SyntaxWarning in several packages
[Message part 1 (text/plain, inline)]
Package: python-x2go

Version: 0.6.1.4

During installation of python3-x2go package, presumably when code is 
compiled, the following warnings are emitted:

Setting up python3-x2go (0.6.1.4-1) ...
/usr/lib/python3/dist-packages/x2go/_paramiko.py:165: SyntaxWarning: 
invalid escape sequence '\['
 if re.match('^\[.*\]\:'+str(SSH_PORT)+'$', hostname):
/usr/lib/python3/dist-packages/x2go/backends/control/plain.py:1426: 
SyntaxWarning: invalid escape sequence '\['
 if re.match('^Name\[%s\]=.*' % lang_regio, line) or 
re.match('Name\[%s\]=.*' % lang_only, line):
/usr/lib/python3/dist-packages/x2go/backends/control/plain.py:1426: 
SyntaxWarning: invalid escape sequence '\['
 if re.match('^Name\[%s\]=.*' % lang_regio, line) or 
re.match('Name\[%s\]=.*' % lang_only, line):
/usr/lib/python3/dist-packages/x2go/backends/control/plain.py:1430: 
SyntaxWarning: invalid escape sequence '\['
 elif re.match('^Comment\[%s\]=.*' % lang_regio, line) or 
re.match('Comment\[%s\]=.*' % lang_only, line):
/usr/lib/python3/dist-packages/x2go/backends/control/plain.py:1430: 
SyntaxWarning: invalid escape sequence '\['
 elif re.match('^Comment\[%s\]=.*' % lang_regio, line) or 
re.match('Comment\[%s\]=.*' % lang_only, line):
/usr/lib/python3/dist-packages/x2go/backends/profiles/httpbroker.py:79: 
SyntaxWarning: invalid escape sequence '\.'
 match = 
re.match('^(?P<protocol>(http(|s)))://(|(?P<user>[a-zA-Z0-9_\.-]+)(|:(?P<password>.*))@)(?P<hostname>[a-zA-Z0-9\.-]+)(|:(?
P<port>[0-9]+))($|/(?P<path>.*)$)', broker_url)
/usr/lib/python3/dist-packages/x2go/utils.py:111: SyntaxWarning: invalid 
escape sequence '\w'
 value = re.sub('[^\w\s-]', '', value).strip().lower()
/usr/lib/python3/dist-packages/x2go/utils.py:531: SyntaxWarning: invalid 
escape sequence '\:'
 return bool((path.startswith('/') or re.match('^[%s]\:\\\\' % 
string.ascii_letters, path)))

====

As these are regex strings, given the specific meaning of escape 
character "\", the most python3-compatible way to suppress these 
warnings, and for compatibility into the future is to convert them to 
raw strings

eg.

 if re.match(*_r_*'^\[.*\]\:'+str(SSH_PORT)+'$', hostname):

====

My platform... not that I think it particularly impacts this bug, or its 
fix...

kubuntu-24.04  pyhoca-cli/0.6.1.3  python3/3.12.3 
remmina-plugin-x2go/1.4.35  remmina/1.4.35  x2goclient/4.1.2.3


These are just console warnings on installation at this time... and can 
be left for one of those days when one is ambivalent about having a 
third bath in a boring day.

I haven't reported this bug elsewhere.

All hail to wonderful package maintainers.


Chris.
[Message part 2 (text/html, inline)]

Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Thu Nov 21 15:36:48 2024; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.