Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#976678: dstat: upgrade warnings when upgrading from python3.8 to python3.9

35 views
Skip to first unread message

Andres Salomon

unread,
Dec 6, 2020, 4:50:03 PM12/6/20
to
Package: dstat
Version: 0.7.4-6

Python 3.9 just migrated to testing yesterday. When I did a
dist-upgrade on my testing machine, I saw the following warnings that
originated from dstat:


Setting up libglib2.0-bin (2.66.3-2) ...
Setting up python3 (3.9.0-3) ...
running python rtupdate hooks for python3.9...
/usr/share/dstat/dstat_mysql_keys.py:41: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
if op.debug > 1: print('%s: exception' (self.filename, e))
/usr/share/dstat/dstat_squid.py:48: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
if op.debug > 1: print('%s: exception' (self.filename, e))
running python post-rtupdate hooks for python3.9...
Setting up libwbclient0:amd64 (2:4.13.2+dfsg-3) ...

It looks to me like you're missing a '%' in both of those print statements:



--- /usr/share/dstat/dstat_squid.py.orig 2020-12-06 16:24:39.563332096 -0500
+++ /usr/share/dstat/dstat_squid.py 2020-12-06 16:25:02.959555941 -0500
@@ -45,7 +45,7 @@
if op.debug > 1: print('%s: lost pipe to squidclient, %s' % (self.filename, e))
for name in self.vars: self.val[name] = -1
except Exception as e:
- if op.debug > 1: print('%s: exception' (self.filename, e))
+ if op.debug > 1: print('%s: exception' % (self.filename, e))
for name in self.vars: self.val[name] = -1

# vim:ts=4:sw=4:et
--- /usr/share/dstat/dstat_mysql_keys.py.orig 2020-12-06 16:24:48.231415192 -0500
+++ /usr/share/dstat/dstat_mysql_keys.py 2020-12-06 16:25:22.959746212 -0500
@@ -38,7 +38,7 @@
for name in self.vars: self.val[name] = -1

except Exception as e:
- if op.debug > 1: print('%s: exception' (self.filename, e))
+ if op.debug > 1: print('%s: exception' % (self.filename, e))
for name in self.vars: self.val[name] = -1

# vim:ts=4:sw=4:et

shirish शिरीष

unread,
Jan 3, 2021, 12:50:03 AM1/3/21
to
Hi all,

I ran into the same bug/issue yesterday -

Setting up python3 (3.9.1-1) ...
running python rtupdate hooks for python3.9...
/usr/share/dstat/dstat_mysql_keys.py:41: SyntaxWarning: 'str' object
is not callable; perhaps you missed a comma?
if op.debug > 1: print('%s: exception' (self.filename, e))
/usr/share/dstat/dstat_squid.py:48: SyntaxWarning: 'str' object is not
callable; perhaps you missed a comma?
if op.debug > 1: print('%s: exception' (self.filename, e))
running python post-rtupdate hooks for python3.9...

--
Regards,
Shirish Agarwal शिरीष अग्रवाल
My quotes in this email licensed under CC 3.0
http://creativecommons.org/licenses/by-nc/3.0/
http://flossexperiences.wordpress.com

E493 D466 6D67 59F5 1FD0 930F 870E 9A5B 5869 609C

Christoph Biedl

unread,
Feb 21, 2021, 11:20:03 AM2/21/21
to
Andres Salomon wrote...

> Python 3.9 just migrated to testing yesterday. When I did a
> dist-upgrade on my testing machine, I saw the following warnings that
> originated from dstat:

Gentle ping? It was nice to have that resolved in bullseye, and the fix
is simple. But time is running up.

If you want somebody to NMU it, just say the word. I could take care to
that, then.

Christoph
signature.asc

Cam Hutchison

unread,
Apr 6, 2021, 2:40:03 AM4/6/21
to
On Sun, 6 Dec 2020 16:31:18 -0500 Andres Salomon <dili...@queued.net> wrote:
>
> --- /usr/share/dstat/dstat_squid.py.orig 2020-12-06 16:24:39.563332096 -0500
> +++ /usr/share/dstat/dstat_squid.py 2020-12-06 16:25:02.959555941 -0500
> @@ -45,7 +45,7 @@
> if op.debug > 1: print('%s: lost pipe to squidclient, %s' % (self.filename, e))
> for name in self.vars: self.val[name] = -1
> except Exception as e:
> - if op.debug > 1: print('%s: exception' (self.filename, e))
> + if op.debug > 1: print('%s: exception' % (self.filename, e))
> for name in self.vars: self.val[name] = -1
>
> # vim:ts=4:sw=4:et
> --- /usr/share/dstat/dstat_mysql_keys.py.orig 2020-12-06 16:24:48.231415192 -0500
> +++ /usr/share/dstat/dstat_mysql_keys.py 2020-12-06 16:25:22.959746212 -0500
> @@ -38,7 +38,7 @@
> for name in self.vars: self.val[name] = -1
>
> except Exception as e:
> - if op.debug > 1: print('%s: exception' (self.filename, e))
> + if op.debug > 1: print('%s: exception' % (self.filename, e))
> for name in self.vars: self.val[name] = -1

These changes are not quite right. Adding the percent will work but
there is only one %s in the format string, so there should be only
one argument on the right-hand side of the percent. Possibly more
correct and useful is to change the print statement to

print('%s: exception: %s' % (self.filename, e))

That will print out the exception message too, which would probably be
useful.
0 new messages