Skip to content

Commit

Permalink
qmk_gui: Fix crash on flashing on Chinese language system
Browse files Browse the repository at this point in the history
Would crash in to_str with
'utf-8' code can't decode byte ...

That's because "VolumeName" the volume name would include Chinese
characters. They should be decodeable by utf8, so not sure why it
happens.
But we don't actually use this in the output.

Also note that the columns aren't orderd the way we ask them, but
alphabetically.

Signed-off-by: Daniel Schaefer <[email protected]>
  • Loading branch information
JohnAZoidberg committed Oct 27, 2023
1 parent 3679a23 commit 0512360
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion uf2conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,10 @@ def to_str(b):
def get_drives():
drives = []
if sys.platform == "win32":
# TODO: Could also check "VolumeName" == "RPI-RP2"
# But it should be okay because we check for the INFO file that no other drive would have
r = subprocess.check_output(["wmic", "PATH", "Win32_LogicalDisk",
"get", "DeviceID,", "VolumeName,",
"get", "DeviceID,",
"FileSystem,", "DriveType"])
for line in to_str(r).split('\n'):
words = re.split('\s+', line)
Expand Down

0 comments on commit 0512360

Please sign in to comment.