ext function returns full hidden file name

Issue #19 wontfix
Anonymous created an issue
Path('test/.hidden.jpg').ext

should return '.jpg' but returns '.hidden.jpg'.

Compare this with os.path:

print(os.path.splitext('test/.hidden.jpg'))
('test/.hidden', '.jpg')

Comments (2)

  1. Antoine Pitrou repo owner

    Thanks for reporting. This is on the PyPI version, not on the PEP 428 version (in the pep428 branch), which behaves properly:

    >>> p = Path('.hidden.jpg')
    >>> p.name
    '.hidden.jpg'
    >>> p.suffix
    '.jpg'
    >>> p.suffixes
    ['.jpg']
    

    I'm not sure I'm going to maintain the non-PEP 428 version (actually, probably not).

  2. Log in to comment