netutils-linux icon indicating copy to clipboard operation
netutils-linux copied to clipboard

rx-buffers-increase error with python 3.9 (debian 11 beta)

Open alekskomp opened this issue 4 years ago • 2 comments

Hello. Got this error:

# rx-buffers-increase enp1s0f0
Traceback (most recent call last):
  File "/usr/local/bin/rx-buffers-increase", line 12, in <module>
    RxBuffersTune()
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_tuning/rx_buffers.py", line 30, in __init__
    self.parse()
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_tuning/rx_buffers.py", line 41, in parse
    self.maximum, self.current = self.parse_ethtool_buffers()
  File "/usr/local/lib/python3.9/dist-packages/netutils_linux_tuning/rx_buffers.py", line 90, in parse_ethtool_buffers
    ethtool_buffers = self.run_ethtool('-g', 1).split('\n')
TypeError: a bytes-like object is required, not 'str'

Should this script even work with 3.9 python version?

# python3 --version
Python 3.9.2

# pip show netutils-linux
Name: netutils-linux
Version: 2.7.11
Summary: Bunch of utils to simplify linux network troubleshooting and performance tuning.
Home-page: https://github.com/strizhechenko/netutils-linux
Author: Oleg Strizhechenko
Author-email: [email protected]
License: MIT
Location: /usr/local/lib/python3.9/dist-packages
Requires: prettytable, colorama, argparse, ipaddress, pyyaml, six
Required-by:

# uname -a
Linux NAT-B-X1 5.10.0-8-amd64 #1 SMP Debian 5.10.46-3 (2021-07-28) x86_64 GNU/Linux

# ethtool -i enp1s0f0
driver: ixgbe
version: 5.10.0-8-amd64
firmware-version: 0x00012b2c
expansion-rom-version: 
bus-info: 0000:01:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes

alekskomp avatar Aug 02 '21 12:08 alekskomp

Hi! I didn't test it with py3.9, the last one was 3.6, but it's weird that it's broken — I don't think they have changed types of subprocesses output between 3.6 and 3.9. Anyway I will try to check/fix it this evening, that shouldn't be really hard. Thank you for reporting the bug and providing detailed information about your environment! :)

strizhechenko avatar Aug 03 '21 03:08 strizhechenko

Should be fixed by: https://github.com/strizhechenko/netutils-linux/pull/228

rayrapetyan avatar Jan 08 '23 04:01 rayrapetyan