Ankesh Saha <[email protected]> added the comment:
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.
----------
nosy: +ankeshsaha
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue28859>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com