Skip to content

Commit 69e8a50

Browse files
BrianPughdpgeorge
authored andcommitted
shutil: Don't allow an empty string in rmtree.
1 parent 4ae896a commit 69e8a50

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

python-stdlib/shutil/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
metadata(version="0.0.4")
1+
metadata(version="0.0.5")
22

33
module("shutil.py")

python-stdlib/shutil/shutil.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77

88
def rmtree(d):
9+
if not d:
10+
raise ValueError
11+
912
for name, type, *_ in os.ilistdir(d):
1013
path = d + "/" + name
1114
if type & 0x4000: # dir

0 commit comments

Comments
 (0)