diff --git a/easybuild/tools/filetools.py b/easybuild/tools/filetools.py index 86ba0f796c..4a3a797be2 100644 --- a/easybuild/tools/filetools.py +++ b/easybuild/tools/filetools.py @@ -430,7 +430,7 @@ def change_dir(path): return cwd -def extract_file(fn, dest, cmd=None, extra_options=None, overwrite=False, forced=False, change_into_dir=None): +def extract_file(fn, dest, cmd=None, extra_options=None, overwrite=False, forced=False, change_into_dir=False): """ Extract file at given path to specified directory :param fn: path to file to extract @@ -439,15 +439,9 @@ def extract_file(fn, dest, cmd=None, extra_options=None, overwrite=False, forced :param extra_options: extra options to pass to extract command :param overwrite: overwrite existing unpacked file :param forced: force extraction in (extended) dry run mode - :param change_into_dir: change into resulting directory; - None (current default) implies True, but this is deprecated, - this named argument should be set to False or True explicitely - (in a future major release, default will be changed to False) + :param change_into_dir: change into resulting directorys :return: path to directory (in case of success) """ - if change_into_dir is None: - _log.deprecated("extract_file function was called without specifying value for change_into_dir", '5.0') - change_into_dir = True if not os.path.isfile(fn) and not build_option('extended_dry_run'): raise EasyBuildError("Can't extract file %s: no such file", fn) diff --git a/test/framework/filetools.py b/test/framework/filetools.py index 5b50296e4c..d3f5d6c0eb 100644 --- a/test/framework/filetools.py +++ b/test/framework/filetools.py @@ -2276,29 +2276,9 @@ def test_extract_file(self): ft.remove_dir(os.path.join(self.test_prefix, 'toy-0.0')) - # a deprecation warning is printed (which is an error in this context) - # if the 'change_into_dir' named argument was left unspecified - error_pattern = "extract_file function was called without specifying value for change_into_dir" - self.assertErrorRegex(EasyBuildError, error_pattern, ft.extract_file, toy_tarball, self.test_prefix) - self.allow_deprecated_behaviour() - - # make sure we're not in self.test_prefix now (checks below assumes so) - self.assertFalse(os.path.samefile(os.getcwd(), self.test_prefix)) - - # by default, extract_file changes to directory in which source file was unpacked - self.mock_stderr(True) - path = ft.extract_file(toy_tarball, self.test_prefix) - stderr = self.get_stderr().strip() - self.mock_stderr(False) - self.assertTrue(os.path.samefile(path, self.test_prefix)) - self.assertTrue(os.path.samefile(os.getcwd(), self.test_prefix)) - regex = re.compile("^WARNING: .*extract_file function was called without specifying value for change_into_dir") - self.assertTrue(regex.search(stderr), "Pattern '%s' found in: %s" % (regex.pattern, stderr)) - ft.change_dir(cwd) self.assertFalse(os.path.samefile(os.getcwd(), self.test_prefix)) - # no deprecation warning when change_into_dir is set to True self.mock_stderr(True) path = ft.extract_file(toy_tarball, self.test_prefix, change_into_dir=True) stderr = self.get_stderr().strip()