It's better to use the ``tempfile.mkdtemp`` module from the standard library to create a temporary directory. That's what this probably should have done to begin with.