- deal with empty tail from os.path.split() (eg. from trailing slash,
or backslash, or whatever)
- check PATH_CREATED hash inside loop as well
return
(head, tail) = os.path.split (name)
+ if not tail: # in case 'name' has trailing slash
+ (head, tail) = os.path.split (head)
tails = [tail] # stack of lone dirs to create
while head and tail and not os.path.isdir (head):
for d in tails:
#print "head = %s, d = %s: " % (head, d),
head = os.path.join (head, d)
+ if PATH_CREATED.get (head):
+ continue
+
if verbose:
print "creating", head