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

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to x2go-dev@lists.x2go.org, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1629; Package python-x2go. (Mon, 22 Jul 2024 13:10:01 GMT) (full text, mbox, link).


Acknowledgement sent to Chris King <chrisking7603@gmail.com>:
New Bug report received and forwarded. Copy sent to X2Go Developers <x2go-dev@lists.x2go.org>. (Mon, 22 Jul 2024 13:10:02 GMT) (full text, mbox, link).


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

From: Chris King <chrisking7603@gmail.com>
To: submit@bugs.x2go.org
Subject: python3 SyntaxWarning in several packages
Date: Mon, 22 Jul 2024 22:36:29 +0930
[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: Sat Sep 7 23:57:52 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.