From 6989acee632c4397506897c1c69ac0a5b3ae3a0b Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Wed, 30 Nov 2022 15:05:17 -0800 Subject: [PATCH] Decode bytes path to str for os.path.ismount Fixes #2221 on Windows --- powerline/lib/vcs/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/powerline/lib/vcs/__init__.py b/powerline/lib/vcs/__init__.py index f862c6bc..8f4a1457 100644 --- a/powerline/lib/vcs/__init__.py +++ b/powerline/lib/vcs/__init__.py @@ -16,7 +16,9 @@ def generate_directories(path): if os.path.isdir(path): yield path while True: - if os.path.ismount(path): + # Work around https://github.com/python/cpython/issues/96192 + _path = os.fsdecode(path) if isinstance(path, bytes) else path + if os.path.ismount(_path): break old_path = path path = os.path.dirname(path)