diff --git a/distro.py b/distro.py index ae91da5..2172e83 100755 --- a/distro.py +++ b/distro.py @@ -1106,7 +1106,7 @@ def _lsb_release_info(self): """ if not self.include_lsb: return {} - with open(os.devnull, "w") as devnull: + with open(os.devnull, "wb") as devnull: try: cmd = ("lsb_release", "-a") stdout = subprocess.check_output(cmd, stderr=devnull) @@ -1144,7 +1144,7 @@ def _parse_lsb_release_content(lines): @cached_property def _uname_info(self): # type: () -> Dict[str, str] - with open(os.devnull, "w") as devnull: + with open(os.devnull, "wb") as devnull: try: cmd = ("uname", "-rs") stdout = subprocess.check_output(cmd, stderr=devnull)