Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use binary file for devnull #271

Merged
merged 3 commits into from
Jul 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down