130
130
base = os.path.basename(new)
131
131
dirname = os.path.dirname(new)
132
tmp_name = u'tmp.%s.%.9f.%d.%d' % (base, time.time(), os.getpid(), random.randint(0, 0x7FFFFFFF))
132
tmp_name = u'tmp.%s.%.9f.%d.%s' % (base, time.time(), os.getpid(), rand_chars(10))
133
133
tmp_name = pathjoin(dirname, tmp_name)
135
135
# Rename the file out of the way, but keep track if it didn't exist