Steve Dower <steve.do...@python.org> added the comment:
ntpath.ismount() is using a name-only check here, it never tries to resolve the path if splitdrive() returns (anything, one_of("", "/", "\\")) Now it's not clear whether handling "" is intended there, but that's certainly the difference (Python 2 required exactly one character in that part). And it appears to be consistent back to 3.4, so I'm not sure we can or should fix anything. The only thing 'F:' can ever be is a mount point. However, we should probably fix the fact that C: returns False. This is because we call abspath(path), and "x:" is a relative path. When the drive does not match the current working drive, you get "x:\\". But when it _does_ match, you get the current working directory, which (unless it's the root directory) is no longer a mount point. Perhaps the best fix for that is to just say that "x:" is a relative path and hence never a mount point? Which would be the same as switching back to the Python 2 behaviour, but would be a much better reason. ---------- nosy: +eryksun title: os.path.ismount() returns true in python 3.7.4 and false in 2.7.14 -> os.path.ismount() returns False for current working drive type: -> behavior versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38948> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com