def split_path(path): path = Resource.normalize(path) fragment = path.rsplit('#', maxsplit=1) if len(fragment) == 2: uri, fragment = fragment else: uri = None return uri, fragment