def strip_fragment(self, path): result = urlparse(path) result = result._replace(fragment='') return six.text_type(urlunparse(result))