Browse Source

Fix Python3 (Windows) compatibility (#15597)

Chris Pepper 5 years ago
parent
commit
11f1392026
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py View File

31
         #
31
         #
32
         import subprocess
32
         import subprocess
33
         # typical result (string): 'Drives: C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
33
         # typical result (string): 'Drives: C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
34
-        driveStr = subprocess.check_output("fsutil fsinfo drives")
34
+        driveStr = subprocess.check_output("fsutil fsinfo drives").decode('utf8')
35
         # typical result (string): 'C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
35
         # typical result (string): 'C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
36
         driveStr = driveStr.strip().lstrip('Drives: ')
36
         driveStr = driveStr.strip().lstrip('Drives: ')
37
         # typical result (array of stings): ['C:\\', 'D:\\', 'E:\\', 'F:\\',
37
         # typical result (array of stings): ['C:\\', 'D:\\', 'E:\\', 'F:\\',
44
         for drive in drives:
44
         for drive in drives:
45
             final_drive_name = drive.strip().rstrip('\\')   # typical result (string): 'C:'
45
             final_drive_name = drive.strip().rstrip('\\')   # typical result (string): 'C:'
46
             try:
46
             try:
47
-                volume_info = subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT)
47
+                volume_info = subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT).decode('utf8')
48
             except Exception as e:
48
             except Exception as e:
49
                 continue
49
                 continue
50
             else:
50
             else:

Loading…
Cancel
Save