def fromBytes(klass, url):
        """
        Make a L{URLPath} from a L{bytes}.

        @param url: A L{bytes} representation of a URL.
        @type url: L{bytes}

        @return: a new L{URLPath} derived from the given L{bytes}.
        @rtype: L{URLPath}

        @since: 15.4
        """
        if not isinstance(url, bytes):
            raise ValueError("'url' must be bytes")
        quoted = urlquote(url, safe=_allascii)
        if isinstance(quoted, bytes):
            # This will only be bytes on python 2, where we can transform it
            # into unicode.  On python 3, urlquote always returns str.
            quoted = quoted.decode("ascii")
        return klass.fromString(quoted)

        Make a L{URLPath} from a L{bytes}.

        @param url: A L{bytes} representation of a URL.
        @type url: L{bytes}

        @return: a new L{URLPath} derived from the given L{bytes}.
        @rtype: L{URLPath}

        @since: 15.4
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/urlpath.py