Backport of new features in Python's os module
