[New-bugs-announce] [issue10948] Trouble with dir_util created dir cache

Diego Queiroz report at bugs.python.org
Wed Jan 19 18:07:18 CET 2011

New submission from Diego Queiroz <queiroz.diego at gmail.com>:

There is a problem with dir_util cache (defined by "_path_created" global variable).

It appears to be useful but it isn't, just repeat these steps to understand the problem I'm facing:

1) Use mkpath to create any path (eg. /home/user/a/b/c)
2) Open the terminal and manually delete the directory "/home/user/a" and its contents
3) Try to create "/home/user/a/b/c" again using mkpath

Expected behavior:
mkpath should create the folder tree again.

What happens:
Nothing, mkpath "thinks" the folder already exists because its creation was cached. Moreover, if you try to create one more folder level (eg. /home/user/a/b/c/d) it raises an exception because it thinks that part of the tree was already created and fails to create the last folder.

I'm working with parallel applications that deal with files asynchronously, this problem gave me a headache.

Anyway, the solution is easy: remove the cache.

assignee: tarek
components: Distutils
messages: 126540
nosy: diegoqueiroz, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: Trouble with dir_util created dir cache
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list