code: def open(self, fullurl, data=None):
          
          fullurl = unwrap(to_bytes(fullurl))
          fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]|")
          if self.tempcache and fullurl in self.tempcache:
              filename, headers = self.tempcache[fullurl]
              fp = open(filename, 'rb')
              return addinfourl(fp, headers, fullurl)
          urltype, url = splittype(fullurl)
          if not urltype:
              urltype = 'file'
          if urltype in self.proxies:
              proxy = self.proxies[urltype]
              urltype, proxyhost = splittype(proxy)
              host, selector = splithost(proxyhost)
              url = (host, fullurl) # Signal special case to open_*()
          else:
              proxy = None
          name = 'open_' + urltype
          self.type = urltype
          name = name.replace('-', '_')
          if not hasattr(self, name):
              if proxy:
                  return self.open_unknown_proxy(proxy, fullurl, data)
              else:
                  return self.open_unknown(fullurl, data)
          try:
              if data is None:
                  return getattr(self, name)(url)
              else:
                  return getattr(self, name)(url, data)
          except HTTPError:
              raise
          except socket.error as msg:
              raise_with_traceback(IOError('socket error', msg))
docs: Use URLopener().open(file) instead of open(file, 'r').