sio / bash-complete-partial-path

Enhanced file path completion in bash (like in zsh)
Apache License 2.0
54 stars 2 forks source link

Tests fail in Python 3.5 #12

Closed sio closed 4 years ago

sio commented 4 years ago

https://github.com/sio/bash-complete-partial-path/blob/51b8ea5d80a60fa4d43ff14c4a67cd9a9ccb6d3b/tests/test_tilde.py#L19

bash = <tests.common.BashSession object at 0x7f573bf48128>, tilde = '~user'

    @pytest.mark.parametrize('tilde', ['~', '~{}'.format(getuser())])
    def test_home(bash, tilde):
        '''~, ~username expansion'''
        home = Path.home()
        subdir = Path('foo/bar/baz')
>       with TemporaryDirectory(prefix='.bcpp-test-', dir=home) as tmpdir:

tests/test_tilde.py:19:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.5/tempfile.py:929: in __init__
    self.name = mkdtemp(suffix, prefix, dir)
/usr/lib/python3.5/tempfile.py:505: in mkdtemp
    file = _os.path.join(dir, prefix + name + suffix)
/usr/lib/python3.5/posixpath.py:89: in join
    genericpath._check_arg_types('join', a, *p)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

funcname = 'join', args = (PosixPath('/home/user'), '.bcpp-test-7ljgdz1i')
hasstr = False, hasbytes = False, s = PosixPath('/home/user')

    def _check_arg_types(funcname, *args):
        hasstr = hasbytes = False
        for s in args:
            if isinstance(s, str):
                hasstr = True
            elif isinstance(s, bytes):
                hasbytes = True
            else:
                raise TypeError('%s() argument must be str or bytes, not %r' %
>                               (funcname, s.__class__.__name__)) from None
E               TypeError: join() argument must be str or bytes, not 'PosixPath'
sio commented 4 years ago

This issue has been fixed in the same branch it was first introduced.