Handling case when paths do not originate on the same root drive
This is an OK case, because we are just trying to validate that short_paths_home is not a subdirectory of the conan cache directory.
If they are on separate drives then that validity condition is satisfied.
@@ -405,8 +405,12 @@ class ConanClientConfigParser(ConfigParser, object):
short_paths_home = get_env("CONAN_USER_HOME_SHORT")
if short_paths_home:
current_dir = os.path.dirname(self.filename)
- if os.path.commonpath([current_dir]) == os.path.commonpath([current_dir, short_paths_home]):
+ try:
+ if current_dir == os.path.commonpath([current_dir, short_paths_home]):
raise ConanException("short_paths_home is the same as, or a subdirectory of, the Conan cache.")
+ except ValueError:
+ # os.path.commonpath() will raise a ValueError if the paths do not have the same root drive
+ pass
return short_paths_home
@property
