Merge 810f7515f99e1cfc4e4848575c88aa8991a1d14a into 574bb1887b9f27b3c046c6b74a1f3ed75b115a75

This commit is contained in:
Heath Stewart 2024-09-29 20:34:40 -07:00 committed by GitHub
commit ad026b07f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)