Commit c98b26a6 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #25596: Falls back to listdir in glob for bytes paths on Windows.

parent 1de1a6a2
......@@ -118,6 +118,15 @@ def _iterdir(dirname, dironly):
else:
dirname = os.curdir
try:
if os.name == 'nt' and isinstance(dirname, bytes):
names = os.listdir(dirname)
if dironly:
for name in names:
if os.path.isdir(os.path.join(dirname, name)):
yield name
else:
yield from names
else:
with os.scandir(dirname) as it:
for entry in it:
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment