Avoid "must be bytes or a tuple of bytes" error with recent Python 3 versions
Full error message: "TypeError: startswith first arg must be bytes or
a tuple of bytes, not str"
Axel Beckert
7 years ago
178 | 178 | dpkgProc = subprocess.Popen(dpkgQuery, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, |
179 | 179 | env = lc_all_c_env) |
180 | 180 | while True: |
181 | line = dpkgProc.stdout.readline() | |
181 | line = dpkgProc.stdout.readline().decode("utf-8") | |
182 | 182 | if not line: |
183 | 183 | break |
184 | 184 | if verbose: |
240 | 240 | dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, |
241 | 241 | env = lc_all_c_env) |
242 | 242 | while True: |
243 | line = dpkgProc.stdout.readline() | |
243 | line = dpkgProc.stdout.readline().decode("utf-8") | |
244 | 244 | if not line: |
245 | 245 | break |
246 | 246 | path = line[:-1] |