Commit 089bc24f authored by jim's avatar jim

Removed an unneeded example that caused a spurious test failure on

non-windows systems.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@88547 62d5b8a3-27da-0310-9561-8e5933582275
parent 52cd8755
...@@ -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
""" """
......
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