Closed Dsibe closed 1 month ago
Just drafted the v. 1.0.39 release, that fixes such bug. Thank you!
Thank you very much for the swift response and release! I have completed all the tests and am glad to say that everything worked successfully with no issues. I truly appreciate your hard work. Have a great day!
Hi! I've encountered an issue related to sorting items on exFAT file systems, specifically on the root directory. After calling the
.sort()
method on the root of an exFAT device, it enters "write-protected" mode, essentially becoming unusable.Problem description
.sort()
method, the drive becomes write-protected.Ways to lift write protection
I found the following methods can lift this write-protected mode:
CHKDSK /F
in the command promptI found these methods to NOT help with the write-protected mode (all of those are commonly recommended when you have issues related to 'locking' or making your devices read-only):
diskpart
and executingattributes clear readonly
.Minimum reproducible example
Create a partition or insert a USB device/SDcard/whatever and assign a drive letter to it.
H:
.Format the drive to exFAT using the following command:
(I use this command as Windows sometimes doesn't show exFAT as an option when using "Disk Management" or formatting from Explorer.)
Run this program:
Running this code, I get the following output (with DEBUG enabled): see this gist
Observations
H:\example_folder
) does not trigger this issue (by usingroot.opendir
followed by a.sort()
).chkdsk H: /f
resolves the write-protection. This suggests that the issue might be related to corruption of the file system or root directory, see output below:Testing Environment
I've made several tests on different physical devices to ensure this isn't device-specific:
Tests were run on two devices (laptop & PC, both running Windows 10). All physical device types showed the same issue. I also used different Python versions - 3.8, 3.10, 3.12.
Thank you for creating such an advanced and useful project! I hope it's possible to find a solution to this bug. Please let me know if you need any additional information from me; I'll be glad to help!