From b34c0e8eb77f736cee388b4ac126946c283e16e8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 4 Nov 2019 16:35:49 +0100 Subject: [PATCH] Don't check A: and B: drives for USB sticks Fixes #2438. --- .../WindowsRemovableDrivePlugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py index 51b6a70b7a..c89bd31e21 100644 --- a/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py +++ b/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py @@ -48,9 +48,13 @@ class WindowsRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin): drives = {} bitmask = ctypes.windll.kernel32.GetLogicalDrives() - # Check possible drive letters, from A to Z + # Check possible drive letters, from C to Z # Note: using ascii_uppercase because we do not want this to change with locale! - for letter in string.ascii_uppercase: + # Skip A and B, since those drives are typically reserved for floppy disks. + # Those drives can theoretically be reassigned but it's safer to not check them for removable drives. + # Windows will also behave weirdly even with some of its internal functions if you do this (e.g. search indexing doesn't search it). + # Users that have removable drives in A or B will just have to save to file and select the drive there. + for letter in string.ascii_uppercase[2:]: drive = "{0}:/".format(letter) # Do we really want to skip A and B?