From b17cbe30e2e8593094b14a5635ff173160f68928 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 8 Feb 2022 17:21:13 +0200 Subject: [PATCH] Strip the path to userhome dir on Linux // Resolve #4173 Issue #4158 --- platformio/project/helpers.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platformio/project/helpers.py b/platformio/project/helpers.py index 73945185..2aab20b7 100644 --- a/platformio/project/helpers.py +++ b/platformio/project/helpers.py @@ -78,9 +78,11 @@ def get_default_projects_dir(): except: # pylint: disable=bare-except if not IS_MACOS: try: - docs_dir = subprocess.check_output( - ["xdg-user-dir", "DOCUMENTS"] - ).decode("utf-8") + docs_dir = ( + subprocess.check_output(["xdg-user-dir", "DOCUMENTS"]) + .decode("utf-8") + .strip() + ) except FileNotFoundError: # command not found pass return os.path.join(docs_dir, "PlatformIO", "Projects")