浏览代码

os.path.normpath filenames to display paths correctly on Windows

(cherry picked from commit e2778cb31c8027371ba48b81b5a03e80cc6bc2ad)
Michael Litvin 3 年之前
父节点
当前提交
ec88ffedd0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      labelme/app.py

+ 1 - 1
labelme/app.py

@@ -2081,7 +2081,7 @@ class MainWindow(QtWidgets.QMainWindow):
         for root, dirs, files in os.walk(folderPath):
             for file in files:
                 if file.lower().endswith(tuple(extensions)):
-                    relativePath = osp.join(root, file)
+                    relativePath = os.path.normpath(osp.join(root, file))
                     images.append(relativePath)
         images = natsort.os_sorted(images)
         return images