From e31591a35e5bd630337ad8b8a9402f647d3d175f Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Tue, 19 May 2020 22:37:05 +0300 Subject: [PATCH] Print warning about an issue with mapped network drives on Windows // Issue #3417 Starting with Python 3.8 paths to mapped network drives are resolved to their real path in the system, e.g.: "Z:\path" becomes "\\path" which causes weird errors in the default terminal with a message that UNC paths are not supported --- platformio/builder/main.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/platformio/builder/main.py b/platformio/builder/main.py index c895f3f3..c35f51c5 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -28,7 +28,7 @@ from SCons.Script import DefaultEnvironment # pylint: disable=import-error from SCons.Script import Import # pylint: disable=import-error from SCons.Script import Variables # pylint: disable=import-error -from platformio import fs +from platformio import compat, fs from platformio.compat import dump_json_to_unicode from platformio.managers.platform import PlatformBase from platformio.proc import get_pythonexe_path @@ -120,6 +120,16 @@ env.Replace( ], ) +if ( + compat.WINDOWS + and sys.version_info >= (3, 8) + and env["PROJECT_DIR"].startswith("\\\\") +): + click.secho( + "There is a known issue with Python 3.8+ and mapped network drives on " + "Windows.\nPlease downgrade Python to the latest 3.7. More details at:\n" + "https://github.com/platformio/platformio-core/issues/3417", fg="yellow") + if env.subst("$BUILD_CACHE_DIR"): if not isdir(env.subst("$BUILD_CACHE_DIR")): makedirs(env.subst("$BUILD_CACHE_DIR"))