tags 917740 +unreproducible +moreinfo severity 917740 normal thanks Rebuilt package in current sid pbuilder env - no failing test. So my fear is that the issue is somehow specific to that environment where it failed or something has changed since then. Lowering severity. I will upload fresh upstream shortly - so we will see if reproduces then
On Sun, 03 Feb 2019, Yaroslav Halchenko wrote: > CHANGES error is benign , will clarify upstream > https://github.com/nipy/nipype/issues/2873 > the actual issue is > > raise TypeError("expected str, bytes or os.PathLike object, > > " > > > "not " + path_type.__name__) > > E TypeError: expected str, bytes or os.PathLike object, not > > unicode > or in full: > > =================================== FAILURES > > =================================== > > _____________________________ test_split_and_merge > > _____________________________ > > tmpdir = local('/tmp/pytest-of-user42/pytest-0/test_split_and_merge0') > > def test_split_and_merge(tmpdir): > > import numpy as np > > import nibabel as nb > > import os.path as op > > import os > > from nipype.algorithms.misc import split_rois, merge_rois > > in_mask = example_data('tpms_msk.nii.gz') > > dwfile = tmpdir.join('dwi.nii.gz').strpath > > mskdata = nb.load(in_mask, mmap=NUMPY_MMAP).get_data() > > aff = nb.load(in_mask, mmap=NUMPY_MMAP).affine > > dwshape = (mskdata.shape[0], mskdata.shape[1], mskdata.shape[2], 6) > > dwdata = np.random.normal(size=dwshape) > > tmpdir.chdir() > > nb.Nifti1Image(dwdata.astype(np.float32), aff, > > None).to_filename(dwfile) > > > resdw, resmsk, resid = split_rois(dwfile, in_mask, roishape=(20, > > > 20, 2)) > > /<<PKGBUILDDIR>>/nipype/algorithms/tests/test_splitmerge.py:26: > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > > _ _ > > /<<PKGBUILDDIR>>/nipype/algorithms/misc.py:1318: in split_rois > > np.savez(iname, (nzels[0][first:last], )) > > /usr/lib/python2.7/dist-packages/numpy/lib/npyio.py:619: in savez > > _savez(file, args, kwds, False) > > /usr/lib/python2.7/dist-packages/numpy/lib/npyio.py:700: in _savez > > file = os_fspath(file) > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > > _ _ > > path = > > '/tmp/pytest-of-user42/pytest-0/test_split_and_merge0/roi0000000000_idx' > > def os_fspath(path): > > """Return the path representation of a path-like object. > > If str or bytes is passed in, it is returned unchanged. Otherwise > > the > > os.PathLike interface is used to get the path representation. If the > > path representation is not str or bytes, TypeError is raised. If the > > provided path is not str, bytes, or os.PathLike, TypeError is > > raised. > > """ > > if isinstance(path, (str, bytes)): > > return path > > # Work from the object's type to match method resolution of other > > magic > > # methods. > > path_type = type(path) > > try: > > path_repr = path_type.__fspath__(path) > > except AttributeError: > > if hasattr(path_type, '__fspath__'): > > raise > > elif PurePath is not None and issubclass(path_type, PurePath): > > return _PurePath__fspath__(path) > > else: > > raise TypeError("expected str, bytes or os.PathLike object, > > " > > > "not " + path_type.__name__) > > E TypeError: expected str, bytes or os.PathLike object, not > > unicode > > /usr/lib/python2.7/dist-packages/numpy/compat/py3k.py:237: TypeError -- Yaroslav O. Halchenko Center for Open Neuroscience http://centerforopenneuroscience.org Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755 Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419 WWW: http://www.linkedin.com/in/yarik