Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.buildout
Commits
edf5d873
Commit
edf5d873
authored
Jul 18, 2008
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed an unneeded example that caused a spurious test failure on
non-windows systems.
parent
422d4394
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
src/zc/buildout/rmtree.py
src/zc/buildout/rmtree.py
+6
-12
No files found.
src/zc/buildout/rmtree.py
View file @
edf5d873
...
@@ -24,38 +24,32 @@ def rmtree (path):
...
@@ -24,38 +24,32 @@ def rmtree (path):
read only file.
read only file.
This tries to chmod the file to writeable and retries before giving up.
This tries to chmod the file to writeable and retries before giving up.
>>> import shutil
>>> from tempfile import mkdtemp
>>> from tempfile import mkdtemp
Let's make a directory ...
Let's make a directory ...
>>> d = mkdtemp()
>>> d = mkdtemp()
and make sure it is actually there
and make sure it is actually there
>>> os.path.isdir (d)
>>> os.path.isdir (d)
1
1
Now create a file ...
Now create a file ...
>>> foo = os.path.join (d, 'foo')
>>> foo = os.path.join (d, 'foo')
>>> open (foo, 'w').write ('huhu')
>>> open (foo, 'w').write ('huhu')
and make it unwriteable
and make it unwriteable
>>> os.chmod (foo, 0400)
now let's see how shutil.rmtree behaves
>>> shutil.rmtree (d) # doctest: +ELLIPSIS
>>> os.chmod (foo, 0400)
Traceback (most recent call last):
...
OSError: [Errno 13] Permission denied: '...foo'
the directory is still there!
rmtree should be able to remove it:
>>> os.path.isdir (d)
1
the new function should be able to solve this for us
>>> rmtree (d)
>>> rmtree (d)
and now the directory is gone
and now the directory is gone
>>> os.path.isdir (d)
>>> os.path.isdir (d)
0
0
"""
"""
...
...
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