[PATCH v2] build-many-glibcs.py: Include URL in download exception

Carlos O'Donell carlos@redhat.com
Tue Dec 9 00:19:26 GMT 2025


On 12/9/25 7:31 AM, Florian Weimer wrote:
> ---

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> v2: Rebased, hopefully this will allow CI to apply the patch.
>  scripts/build-many-glibcs.py | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
> index 586a2d8f83..940b66a09a 100755
> --- a/scripts/build-many-glibcs.py
> +++ b/scripts/build-many-glibcs.py
> @@ -1074,8 +1074,11 @@ class Context(object):
>          baseurl = os.environ.get('FTP_GNU_ORG_MIRROR' , 'https://ftp.gnu.org').rstrip('/')
>          url = url_map[component] % {'version': version, 'major': version_major, 'baseurl': baseurl}
>          filename = os.path.join(self.srcdir, url.split('/')[-1])
> -        response = urllib.request.urlopen(url)
> -        data = response.read()

OK. Yes, this was super annoying when I was testing this that you don't get good error messages.

> +        try:
> +            with urllib.request.urlopen(url) as response:
> +                data = response.read()
> +        except:
> +            raise IOError('downloading ' + repr(url))

OK. Raises IOError with more information (very useful!).

>          with open(filename, 'wb') as f:
>              f.write(data)
>          subprocess.run(['tar', '-C', self.srcdir, '-x', '-f', filename],
> 
> base-commit: f56a71097f39f2737e76b3807201a4028e06c611
> 


-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list