From de83e2ce43101ddb8b5aeaa5c3e18d1e5c85590a Mon Sep 17 00:00:00 2001 From: Michael Goulding Date: Wed, 17 Jul 2024 00:49:34 -0700 Subject: [PATCH] `LocalTransport`: Fix typo for `ignore_nonexisting` in `put` (#6471) The `LocalTransport.put` method contained a typo and so would check for the `ignore_noexisting` argument instead of `ignore_nonexisting`. The typo is corrected but for backwards compatibility the method continues to check for the misspelled version emitting a deprecation warning. --- src/aiida/transports/plugins/local.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/aiida/transports/plugins/local.py b/src/aiida/transports/plugins/local.py index 0740837fc4..b8263620d3 100644 --- a/src/aiida/transports/plugins/local.py +++ b/src/aiida/transports/plugins/local.py @@ -228,9 +228,18 @@ def put(self, localpath, remotepath, *args, **kwargs): :raise OSError: if remotepath is not valid :raise ValueError: if localpath is not valid """ + from aiida.common.warnings import warn_deprecation + + if 'ignore_noexisting' in kwargs: + # Backwards compatibility check for old keyword that was misspelled + warn_deprecation( + 'Detected `ignore_noexisting` which is now deprecated. Use `ignore_nonexisting` instead.', version=3 + ) + ignore_nonexisting = kwargs.get('ignore_noexisting', args[2] if len(args) > 2 else False) + dereference = kwargs.get('dereference', args[0] if args else True) overwrite = kwargs.get('overwrite', args[1] if len(args) > 1 else True) - ignore_nonexisting = kwargs.get('ignore_noexisting', args[2] if len(args) > 2 else False) + ignore_nonexisting = kwargs.get('ignore_nonexisting', args[2] if len(args) > 2 else False) if not remotepath: raise OSError('Input remotepath to put function must be a non empty string') if not localpath: