From c428e382f43ef29d7d9dc5c3b56e04d3461f76a3 Mon Sep 17 00:00:00 2001 From: Joe Hultgren Date: Mon, 8 Apr 2019 10:53:46 -0700 Subject: [PATCH] On windows compare paths case insensitively --- python/tk_multi_publish2/util.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/tk_multi_publish2/util.py b/python/tk_multi_publish2/util.py index 806b747b..dc205801 100644 --- a/python/tk_multi_publish2/util.py +++ b/python/tk_multi_publish2/util.py @@ -10,6 +10,7 @@ import os import pprint +import sys import sgtk @@ -340,6 +341,9 @@ def get_conflicting_publishes(context, path, publish_name, filters=None): # ensure the path is normalized for comparison normalized_path = sgtk.util.ShotgunPath.normalize(path) + # on windows compare paths case insensitively + if sys.platform == "win32": + normalized_path = normalized_path.lower() # next, extract the publish path from each of the returned publishes and # compare it against the supplied path. if the paths match, we add the @@ -352,6 +356,10 @@ def get_conflicting_publishes(context, path, publish_name, filters=None): # ensure the published path is normalized for comparison normalized_publish_path = sgtk.util.ShotgunPath.normalize( publish_path) + + if sys.platform == "win32": + normalized_publish_path = normalized_publish_path.lower() + if normalized_path == normalized_publish_path: matching_publishes.append(publish)