Package: munin-plugins-extra
Version: 2.0.42-5~bpo9+1
Severity: normal

Dear Maintainer,

I'm no Python expert, but it appears that a code change¹ made to munin
plugin ipmi_sensor_ is broken on systems with Python 3.5.3.

  # munin-run ipmi_sensor_u_rpm
  Traceback (most recent call last):
    File "/etc/munin/plugins/ipmi_sensor_u_rpm", line 224, in <module>
      line = line.decode()
  AttributeError: 'str' object has no attribute 'decode'

The code in question is:

   75: CONFIG = '/etc/munin/ipmi'
    …
  222: if access(CONFIG, R_OK):
  223:    for line in open(CONFIG):
  224:        line = line.decode()

The built-in open()² function is reading the file in text-mode with
platform default encoding, and the 'line' variable is a 'str' object,
not a 'bytes' object that needs to be decoded.

Perhaps some variant of Python 3 has a decode method on str objects, or
open() returns bytes objects by default?  Otherwise my guess is nobody
ever executed this plugin since the 2.0.38 release.

¹ 
https://github.com/munin-monitoring/munin/commit/8637ee5244c20f4432dea5fa15ad234f98b23d1d
² https://docs.python.org/3.5/library/functions.html#open

-- System Information:
Debian Release: 9.6
  APT prefers stable
  APT policy: (601, 'stable'), (500, 'stable-updates'), (500, 'stable-debug')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.18.0-0.bpo.1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages munin-plugins-extra depends on:
ii  munin-common  2.0.42-5~bpo9+1
ii  perl          5.24.1-3+deb9u4

munin-plugins-extra recommends no packages.

Versions of packages munin-plugins-extra suggests:
pn  libcache-memcached-perl  <none>
ii  libnet-ip-perl           1.26-1
ii  libnet-netmask-perl      1.9022-1
ii  libnet-snmp-perl         6.0.1-2
ii  libnet-telnet-perl       3.04-1
ii  libtext-csv-xs-perl      1.26-1
ii  libxml-libxml-perl       2.0128+dfsg-1+deb9u1
ii  python3                  3.5.3-1

-- Configuration Files:
/etc/munin/plugin-conf.d/dhcpd3 [Errno 13] Permission denied: 
'/etc/munin/plugin-conf.d/dhcpd3'
/etc/munin/plugin-conf.d/spamstats [Errno 13] Permission denied: 
'/etc/munin/plugin-conf.d/spamstats'

-- no debconf information

-- 
Gerald Turner <gtur...@unzane.com>        Encrypted mail preferred!
OpenPGP: 4096R / CA89 B27A 30FA 66C5 1B80  3858 EC94 2276 FDB8 716D

Attachment: signature.asc
Description: PGP signature

Reply via email to