PolicyStat/terrarium — pull request #48 by trimtab613 (2014-04-16 06:51:45+00:00)
Title: Replace os.rename with shutil.move

### Summary

In some cases where multiple mounts are used, the code crashes with `[Errno 18] Invalid cross-device link`. For example, [Codeship](http://www.codeship.io/) build servers are designed in a way that causes this problem.

As mentioned in a few places online (see below) one solution is to use `shutil.move` instead of `os.rename`, and that is the change that this pull request makes.

### Caution

One difference between `os.rename` and `shutil.move` is described in [pip pull request #103](https://github.com/pypa/pip/issues/103). Apparently the former creates directories as needed but the latter does not. I am not knowledgable enough about terrarium to decide if that is a problem.

### See Also

* https://mail.python.org/pipermail/python-list/2005-February/342893.html
* http://stackoverflow.com/questions/11578443/trigger-io-errno-18-cross-device-link