urllib.urlopen doesn't accept Unicode strings.

Syver Enstad syver at NOSPAMcyberwatcher.com
Tue Mar 20 19:38:46 EST 2001


The offending line is at 241 in urllib.py (python 2.0)

    def open_http(self, url, data=None):
        """Use HTTP protocol."""
        import httplib
        user_passwd = None
        # next line patched, original line was: if type(url) is type(""):
        if type(url) is type("") or type(url) is type(u""):
            host, selector = splithost(url)
            if host:

Or maybe this has been fixed in Python 2.1?





More information about the Python-list mailing list