bat-serjo / PyIface

Python module to control network interfaces.
GNU General Public License v3.0
21 stars 10 forks source link

Interface.name: decode() string to utf8 before return #20

Closed harisokanovic closed 5 years ago

harisokanovic commented 6 years ago

Signed-off-by: Haris Okanovic haris.okanovic@ni.com

harisokanovic commented 6 years ago

Testing: I verified python3 -c 'import pyiface; print(pyiface.getIfaces()[0].name)' prints a non-binary string object. It previously printed something like b'eth0' in python3 and eth0 in python2. Now prints eth0 in both cases.

harisokanovic commented 6 years ago

Note: I fixed a small bug in my branch. Added backslashreplace option to decode() to catch any non-utf8 chars. I'm not sure if this pull request got updated or not. I can re-create it, if necessary.