code: def open_url_seekable(path_url, mode='rt'):
      
  
      logging.debug("Making request to '%s'", path_url)
      response = urllib.request.urlopen(path_url)
      logging.debug("Got response %s", response.info())
  
      try:
          response.seek(0)
      except (IOError, AttributeError):
          # Copy into buffer to allow seeking.
          response = io.BytesIO(response.read())
      if "b" in mode:
          return response
      else:
          return io.TextIOWrapper(response)
docs: Open a URL and ensure that the result is seekable,
      copying it into a buffer if necessary.