Skip to content
Snippets Groups Projects
Unverified Commit 367f5521 authored by Christoph Anton Mitterer's avatar Christoph Anton Mitterer Committed by GitHub
Browse files

gh-96192: fix os.ismount() to use a path that is str or bytes (#96194)

parent 1455c516
No related branches found
No related tags found
No related merge requests found
......@@ -195,6 +195,7 @@ def ismount(path):
if stat.S_ISLNK(s1.st_mode):
return False
path = os.fspath(path)
if isinstance(path, bytes):
parent = join(path, b'..')
else:
......
......@@ -178,6 +178,8 @@ def test_islink(self):
def test_ismount(self):
self.assertIs(posixpath.ismount("/"), True)
self.assertIs(posixpath.ismount(b"/"), True)
self.assertIs(posixpath.ismount(FakePath("/")), True)
self.assertIs(posixpath.ismount(FakePath(b"/")), True)
def test_ismount_non_existent(self):
# Non-existent mountpoint.
......
Fix handling of ``bytes`` :term:`path-like objects <path-like object>` in :func:`os.ismount()`.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment