From b2483e28d1608bcb78a69c293fa9f14206cbc599 Mon Sep 17 00:00:00 2001 From: jllllll <3887729+jllllll@users.noreply.github.com> Date: Sat, 17 Jun 2023 17:09:22 -0500 Subject: [PATCH] Check for special characters in path on Windows (#81) Display warning message if detected --- webui.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webui.py b/webui.py index 00b0fbd6..52993184 100644 --- a/webui.py +++ b/webui.py @@ -68,6 +68,15 @@ def check_env(): def install_dependencies(): + # Check for special characters in installation path on Windows + if sys.platform.startswith("win"): + # punctuation contains: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ + from string import punctuation + # Allow some characters: _-:\/.'" + special_characters = punctuation.translate({ord(char): None for char in '_-:\\/.\'"'}) + if any(char in script_dir for char in special_characters): + print_big_message("WARNING: Special characters were detected in the installation path!\n This can cause the installation to fail!") + # Select your GPU or, choose to run in CPU mode print("What is your GPU") print()