[Distutils] remove_tree and PATH_CREATED

Bastian Kleineidam calvin@cs.uni-sb.de
Thu, 8 Jun 2000 12:15:07 +0200 (CEST)


Hi,

in dir_util.py we have a cache which directories are 
created: PATH_CREATED. This is filled by mkpath. But it is not
emptied by remove_tree because we use shutil.rmtree for this.

Reproduce: run "python setup.py sdist bdist_rpm"
sdist creates a distribution dir, then deletes it. bdist_rpm runs
sdist again and the distribution dir is not created a second time 
because its in the cache PATH_CREATED.

Solution 1: find all directories to be removed and remove them out of
PATH_CREATED. However if rmtree gives an error we removed probably too
much.

Solution 2: get rid of the PATH_CREATED cache. Not a good solution.

Solution 3: write your own rmtree function.
I would prefer this solution.

Bastian