Skip to content

Commit f815a2a

Browse files
committed
os: Proactively filter all str/bytes variants of "."/"..".
1 parent eb09814 commit f815a2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

os/os/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def listdir(path="."):
132132
res = []
133133
for dirent in ilistdir(path):
134134
fname = dirent[0]
135-
if fname != b"." and fname != b"..":
135+
if fname not in (b".", b"..", ".", ".."):
136136
if is_str:
137137
fname = fsdecode(fname)
138138
res.append(fname)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy