Message365591
s I have tried to workout a solution for the problem. Below is my observation and possible solution.
os.path.ismount("F:\\doesnotexist")
Exception occurs for the above line if the system fails to find both drive and the path that follows it.
A 'FileNotFoundError' exception is thrown. If we can handle this exception and return false for method ismount(), then problem can be resolved.
I changed the existing code ismount method and it is working.
Existing code=>
if _getvolumepathname:
return path.rstrip(seps) == _getvolumepathname(path).rstrip(seps)
else:
return False
Changed Code=>
if _getvolumepathname:
try:
return path.rstrip(seps) == _getvolumepathname(path).rstrip(seps)
except FileNotFoundError:
return False
Please check, if this solution is correct. |
|
Date |
User |
Action |
Args |
2020-04-02 13:07:34 | ankeshsaha | set | recipients:
+ ankeshsaha, paul.moore, tim.golden, zach.ware, steve.dower, wolma, lazka, Dan Arad, scic0, sdcards, akarei, AkechiShiro |
2020-04-02 13:07:34 | ankeshsaha | set | messageid: <1585832854.88.0.719398761292.issue28859@roundup.psfhosted.org> |
2020-04-02 13:07:34 | ankeshsaha | link | issue28859 messages |
2020-04-02 13:07:34 | ankeshsaha | create | |
|