summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAyman Bagabas <ayman.bagabas@gmail.com>2019-10-01 20:56:16 -0400
committerDrashna Jael're <drashna@live.com>2019-12-05 16:03:49 -0800
commitc29b1da096218cf095be272dda875f7a00f3fd32 (patch)
tree878d00a038900fed5fcade729a663f04bb59f085 /lib
parentdfda3cf71dab2b5caa05aa0c64674540fa831c0c (diff)
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'
Diffstat (limited to 'lib')
-rwxr-xr-xlib/python/qmk/cli/doctor.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/python/qmk/cli/doctor.py b/lib/python/qmk/cli/doctor.py
index 3474422a89..2b6a03e443 100755
--- a/lib/python/qmk/cli/doctor.py
+++ b/lib/python/qmk/cli/doctor.py
@@ -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'):