Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0076ca4

Browse files
miss-islingtoncalestyoeryksunJelleZijlstra
authored
gh-96192: fix os.ismount() to use a path that is str or bytes (GH-96194)
(cherry picked from commit367f552)Co-authored-by: Christoph Anton Mitterer <calestyo@scientia.org>Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>Co-authored-by: Eryk Sun <eryksun@gmail.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parentf4511d3 commit0076ca4

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

‎Lib/posixpath.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def ismount(path):
195195
ifstat.S_ISLNK(s1.st_mode):
196196
returnFalse
197197

198+
path=os.fspath(path)
198199
ifisinstance(path,bytes):
199200
parent=join(path,b'..')
200201
else:

‎Lib/test/test_posixpath.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ def test_islink(self):
178178
deftest_ismount(self):
179179
self.assertIs(posixpath.ismount("/"),True)
180180
self.assertIs(posixpath.ismount(b"/"),True)
181+
self.assertIs(posixpath.ismount(FakePath("/")),True)
182+
self.assertIs(posixpath.ismount(FakePath(b"/")),True)
181183

182184
deftest_ismount_non_existent(self):
183185
# Non-existent mountpoint.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix handling of ``bytes``:term:`path-like objects <path-like object>` in:func:`os.ismount()`.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp