[New-bugs-announce] [issue28859] os.path.mount sometimes raises FileNotFoundError on Windows

Christoph Reiter report at bugs.python.org
Fri Dec 2 09:39:20 EST 2016


New submission from Christoph Reiter:

It returns True for drives which don't exist and raises for paths starting with drives which don't exist.

>>> os.path.exists("C:\\")
True
>>> os.path.ismount("C:\\")
True
>>> os.path.ismount("C:\\doesnotexist")
False
>>> os.path.exists("F:\\")
False
>>> os.path.ismount("F:\\")
True
>>> os.path.ismount("F:\\doesnotexist")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\lazka\AppData\Local\Programs\Python\Python35\lib\ntpath.py", line 290, in ismount
    return path.rstrip(seps) == _getvolumepathname(path).rstrip(seps)
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'F:\\doesnotexist'

----------
components: Windows
messages: 282241
nosy: lazka, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.path.mount sometimes raises FileNotFoundError on Windows
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28859>
_______________________________________


More information about the New-bugs-announce mailing list