Browse Source

Fix qmk doctor 'bytes-like object is required' on linux

This fixes the following issue related to encoding on linux systems. Add
`universal_newlines=True` to subprocess.

<class 'TypeError'>
☒ a bytes-like object is required, not 'str'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/milc.py", line 564, in __call__
    return self.__call__()
  File "/usr/local/lib/python3.7/site-packages/milc.py", line 569, in __call__
    return self._entrypoint(self)
  File "$HOME/qmk_firmware/lib/python/qmk/cli/doctor.py", line 56, in doctor
    for line in mm_check.stdout.split('\n'):
TypeError: a bytes-like object is required, not 'str'
pull/6893/head 0.7.30
Ayman Bagabas 4 years ago
committed by skullydazed
parent
commit
9067dc817a
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lib/python/qmk/cli/doctor.py

+ 1
- 1
lib/python/qmk/cli/doctor.py View File

@ -50,7 +50,7 @@ def doctor(cli):
elif OS == "Linux":
cli.log.info("Detected {fg_cyan}Linux.")
if shutil.which('systemctl'):
mm_check = subprocess.run(['systemctl', 'list-unit-files'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=10)
mm_check = subprocess.run(['systemctl', 'list-unit-files'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=10, universal_newlines=True)
if mm_check.returncode == 0:
mm = True
for line in mm_check.stdout.split('\n'):


Loading…
Cancel
Save