diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 6d8233190a..9c1e1b1ffd 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -221,6 +221,9 @@ def __init__(self, infields=None, **kwargs): self.inputs.trait_set(trait_change_notify=False, **undefined_traits) def _get_dst(self, src): + ## If path is directory with trailing os.path.sep, + ## then remove that for a more robust behavior + src = src.rstrip(os.path.sep) path, fname = os.path.split(src) if self.inputs.parameterization: dst = path