diff --git a/xcp/net/biosdevname.py b/xcp/net/biosdevname.py index 78995056..60ddfe82 100644 --- a/xcp/net/biosdevname.py +++ b/xcp/net/biosdevname.py @@ -65,7 +65,7 @@ def all_devices_all_names(): if retcode: continue - for device in (x.strip() for x in stdout.split("\n\n") if len(x)): + for device in (x.strip() for x in stdout.decode().split("\n\n") if len(x)): dinfo = {} for l in device.split("\n"): diff --git a/xcp/pci.py b/xcp/pci.py index 1c8e081d..703ab85d 100644 --- a/xcp/pci.py +++ b/xcp/pci.py @@ -186,7 +186,7 @@ def __init__(self, fn): vendor = None cls = None - fh = open(fn) + fh = open(fn, 'r', encoding='UTF-8') for l in fh: line = l.rstrip() if line == '' or line.startswith('#'): @@ -260,7 +260,7 @@ def __init__(self): stdout = subprocess.PIPE) for l in cmd.stdout: line = l.rstrip() - el = [x for x in line.replace('"', '').split() if not x.startswith('-')] + el = [x for x in line.decode().replace('"', '').split() if not x.startswith('-')] self.devs[el[0]] = {'id': el[0], 'class': el[1][:2], 'subclass': el[1][2:],