Skip to content

Conversation

Louwrensth
Copy link
Contributor

Urlencoded characters (e.g. '%2F' instead of '/') caused an error while reporting download error.

This is a fixup of PR #3976 that introduced a regression.

The error would be a TypeError: not enough arguments for format string, e.g.:

ERROR: Traceback (most recent call last):
  File "/home/ITER/vandell/easybuildinstall/software/EasyBuild/4.5.4/lib/python3.6/site-packages/easybuild/main.py", line 128, in build_and_install_software
    (ec_res['success'], app_log, err) = build_and_install_one(ec, init_env)
  File "/home/ITER/vandell/easybuildinstall/software/EasyBuild/4.5.4/lib/python3.6/site-packages/easybuild/framework/easyblock.py", line 4058, in build_and_install_one
    result = app.run_all_steps(run_test_cases=run_test_cases)
  File "/home/ITER/vandell/easybuildinstall/software/EasyBuild/4.5.4/lib/python3.6/site-packages/easybuild/framework/easyblock.py", line 3941, in run_all_steps
    self.run_step(step_name, step_methods)
  File "/home/ITER/vandell/easybuildinstall/software/EasyBuild/4.5.4/lib/python3.6/site-packages/easybuild/framework/easyblock.py", line 3776, in run_step
    step_method(self)()
  File "/home/ITER/vandell/easybuildinstall/software/EasyBuild/4.5.4/lib/python3.6/site-packages/easybuild/easyblocks/generic/configuremake.py", line 219, in fetch_step
    super(ConfigureMake, self).fetch_step(*args, **kwargs)
  File "/home/ITER/vandell/easybuildinstall/software/EasyBuild/4.5.4/lib/python3.6/site-packages/easybuild/framework/easyblock.py", line 2246, in fetch_step
    self.fetch_sources(self.cfg['sources'], checksums=self.cfg['checksums'])
  File "/home/ITER/vandell/easybuildinstall/software/EasyBuild/4.5.4/lib/python3.6/site-packages/easybuild/framework/easyblock.py", line 445, in fetch_sources
    src_spec = self.fetch_source(source, self.get_checksum_for(checksums=checksums, index=index))
  File "/home/ITER/vandell/easybuildinstall/software/EasyBuild/4.5.4/lib/python3.6/site-packages/easybuild/framework/easyblock.py", line 404, in fetch_source
    download_instructions=download_instructions)
  File "/home/ITER/vandell/easybuildinstall/software/EasyBuild/4.5.4/lib/python3.6/site-packages/easybuild/framework/easyblock.py", line 891, in obtain_file
    raise EasyBuildError(error_msg, filename)
  File "/home/ITER/vandell/easybuildinstall/software/EasyBuild/4.5.4/lib/python3.6/site-packages/easybuild/tools/build_log.py", line 86, in __init__
    raise(e)
  File "/home/ITER/vandell/easybuildinstall/software/EasyBuild/4.5.4/lib/python3.6/site-packages/easybuild/tools/build_log.py", line 80, in __init__
    msg = msg % args
TypeError: not enough arguments for format string

…e dead code dealing with download instructions in fetch_source

Urlencoded characters (e.g. '%2F' instead of '/') caused an error while reporting download error.
@boegel boegel added the bug fix label May 11, 2022
@boegel boegel added this to the next release (4.5.5?) milestone May 11, 2022
@boegel boegel changed the title fixup! tweak printing of download instructions in obtain_file + remov… fix printing of download instructions when url-encoded characters are used in URL May 11, 2022
@boegel boegel changed the title fix printing of download instructions when url-encoded characters are used in URL fix printing of list of attempted download URLs when url-encoded characters are used in URL May 11, 2022
@boegel
Copy link
Member

boegel commented May 11, 2022

@Louwrensth Thanks for the fix!

I've added a small enhancement for the test for the obtain_file method that would have caught this, to make sure we don't re-introduce a silly bug like this again going forward...

@boegel boegel enabled auto-merge May 11, 2022 12:35
@boegel boegel merged commit afe4fcd into easybuilders:develop May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants