You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use dir command on Windows for checking mount points
If you call `os.path.exists` on a removable drive that is currently in the
"ejected" state (which often happens when flashing multiple devices at the
same time), then an error dialog will be shown that blocks the python
process until the user interacts with it. You can globally disable these
error boxes, but this is undesirable as it may mask other errors that occur.
Windows has APIs that allow it to check if a device is ready before
accessing the file system, however this is hard to access from Python.
Instead, we use the `dir` command, which will error but not cause a blocking
error dialog. For other OSes, we just use `os.path.exists`.
0 commit comments