consider ``os.path.normpath``, which will deal with more types of anomalies. For example:

```
>>> os.path.normpath('a/b//c///d/./e/f')
'a/b/c/d/e/f'
```