Page MenuHomeSoftware Heritage

nixguix: Add support for pseudo-URLs with a missing schema
Open, NormalPublic

Description

Some URLs in Nixpkgs don't have a schema when they should have http://. This is valid for Nix, so the Nixguix loader should accept them too.

For example: https://sentry.softwareheritage.org/share/issue/0cf519830d45466582f35968317aa8c0/

MissingSchema: Invalid URL 'www.roudoudou.com/export/cpc/rasm/rasm_v0117_src.zip': No schema supplied. Perhaps you meant http://www.roudoudou.com/export/cpc/rasm/rasm_v0117_src.zip?
  File "swh/loader/package/loader.py", line 576, in load
    res = self._load_revision(p_info, origin)
  File "swh/loader/package/loader.py", line 713, in _load_revision
    dl_artifacts = self.download_package(p_info, tmpdir)
  File "swh/loader/package/loader.py", line 364, in download_package
    return [download(p_info.url, dest=tmpdir, filename=p_info.filename)]
  File "swh/loader/package/utils.py", line 79, in download
    response = requests.get(url, **params, timeout=timeout, stream=True)
  File "requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "requests/sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "requests/sessions.py", line 462, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "requests/models.py", line 387, in prepare_url
    raise MissingSchema(error)

Event Timeline

vlorentz triaged this task as Normal priority.Mon, Apr 26, 2:18 PM
vlorentz created this task.