Author ankeshsaha
Recipients AkechiShiro, Dan Arad, akarei, ankeshsaha, lazka, paul.moore, scic0, sdcards, steve.dower, tim.golden, wolma, zach.ware
Date 2020-04-02.13:07:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585832854.88.0.719398761292.issue28859@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-04-02 13:07:34ankeshsahasetrecipients: + ankeshsaha, paul.moore, tim.golden, zach.ware, steve.dower, wolma, lazka, Dan Arad, scic0, sdcards, akarei, AkechiShiro
2020-04-02 13:07:34ankeshsahasetmessageid: <1585832854.88.0.719398761292.issue28859@roundup.psfhosted.org>
2020-04-02 13:07:34ankeshsahalinkissue28859 messages
2020-04-02 13:07:34ankeshsahacreate