Fix T54029: Wrong preset name display in win32
authorCampbell Barton <ideasman42@gmail.com>
Mon, 26 Feb 2018 08:05:01 +0000 (19:05 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 26 Feb 2018 08:05:01 +0000 (19:05 +1100)
release/scripts/modules/bpy/path.py

index 0bfb14e4e0dd535fb717c803332238b5965acbea..a88e60d002203a218130f9f687df6e483f7d1d86 100644 (file)
@@ -187,7 +187,6 @@ clean_name._trans_cache = {}
 
 
 def _clean_utf8(name):
-    name = _os.path.splitext(basename(name))[0]
     if type(name) == bytes:
         return name.decode("utf8", "replace")
     else:
@@ -207,6 +206,9 @@ def display_name(name):
     mixed case names are kept as is. Intended for use with
     filenames and module names.
     """
+
+    name = _os.path.splitext(basename(name))[0]
+
     # string replacements
     for disp_value, file_value in _display_name_literals.items():
         name = name.replace(file_value, disp_value)
@@ -237,6 +239,7 @@ def display_name_from_filepath(name):
     ensured to be utf8 compatible.
     """
 
+    name = _os.path.splitext(basename(name))[0]
     name = _clean_utf8(name)
     return name