Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
d74ba1ec
Commit
d74ba1ec
authored
Sep 28, 2009
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removedir(force=True): guard against new files being created in the target dir
parent
fdeae943
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
fs/osfs.py
+7
-1
No files found.
fs/osfs.py
View file @
d74ba1ec
...
@@ -116,7 +116,13 @@ class OSFS(FS):
...
@@ -116,7 +116,13 @@ class OSFS(FS):
# Don't remove the root directory of this FS
# Don't remove the root directory of this FS
if
path
in
(
""
,
"/"
):
if
path
in
(
""
,
"/"
):
return
return
os
.
rmdir
(
sys_path
)
try
:
os
.
rmdir
(
sys_path
)
except
OSError
,
e
:
if
e
.
errno
!=
errno
.
ENOTEMPTY
or
not
force
:
raise
# Someone has created files in here in the meantime, try again.
self
.
removedir
(
path
,
recursive
=
False
,
force
=
True
)
# Using os.removedirs() for this can result in dirs being
# Using os.removedirs() for this can result in dirs being
# removed outside the root of this FS, so we recurse manually.
# removed outside the root of this FS, so we recurse manually.
if
recursive
:
if
recursive
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment