Pārlūkot izejas kodu

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

(cherry picked from commit e2778cb31c8027371ba48b81b5a03e80cc6bc2ad)
Michael Litvin 3 gadi atpakaļ
vecāks
revīzija
ec88ffedd0
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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 root, dirs, files in os.walk(folderPath):
             for file in files:
             for file in files:
                 if file.lower().endswith(tuple(extensions)):
                 if file.lower().endswith(tuple(extensions)):
-                    relativePath = osp.join(root, file)
+                    relativePath = os.path.normpath(osp.join(root, file))
                     images.append(relativePath)
                     images.append(relativePath)
         images = natsort.os_sorted(images)
         images = natsort.os_sorted(images)
         return images
         return images