Change function for parsing file paths

Raise an error when parsing paths containing consecutive slashes.