Message282241
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' |
|
Date |
User |
Action |
Args |
2016-12-02 14:39:20 | lazka | set | recipients:
+ lazka, paul.moore, tim.golden, zach.ware, steve.dower |
2016-12-02 14:39:20 | lazka | set | messageid: <1480689560.28.0.129916928722.issue28859@psf.upfronthosting.co.za> |
2016-12-02 14:39:20 | lazka | link | issue28859 messages |
2016-12-02 14:39:20 | lazka | create | |
|