From e11cbfc7a90760a04e66e1fbedc264cdfb77145f Mon Sep 17 00:00:00 2001 From: Samuel FORESTIER Date: Sun, 14 Apr 2024 19:44:12 +0200 Subject: [PATCH] [DESKTOP_ENVIRONMENT] Fixes for Python < 3.8 `unittest.mock.mock_open` `__iter__` does not consume `read_data` before Python 3.8, causing tests to fail. --- archey/entries/desktop_environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archey/entries/desktop_environment.py b/archey/entries/desktop_environment.py index 12d3581c..393b4bc4 100644 --- a/archey/entries/desktop_environment.py +++ b/archey/entries/desktop_environment.py @@ -129,7 +129,7 @@ def _environment_detection() -> ( # Don't expect anything from .desktop files and parse them in a best-effort way config = configparser.ConfigParser(allow_no_value=True, strict=False) with open(desktop_file, encoding="utf-8") as f_desktop_file: - config.read_file(f_desktop_file) + config.read_string(f_desktop_file.read()) return ( # Honor `DesktopNames` option with `X-LightDM-DesktopName` as a fallback config.get("Desktop Entry", "DesktopNames", fallback=None)