Bug#976678: dstat: upgrade warnings when upgrading from python3.8 to python3.9
On Sun, 6 Dec 2020 16:31:18 -0500 Andres Salomon 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.
Bug#976678: dstat: upgrade warnings when upgrading from python3.8 to python3.9
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 Description: PGP signature
Bug#976678: dstat: upgrade warnings when upgrading from python3.8 to python3.9
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.orig2020-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.py2020-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