elan-ev / vosk-cli

Apache License 2.0
2 stars 9 forks source link

Fix absolute path detection with empty path components. #28

Open will-ca opened 1 year ago

will-ca commented 1 year ago

Fixes #27.

Untested. But should be simple enough.

https://docs.python.org/3/library/os.path.html#os.path.abspath https://docs.python.org/3/library/os.path.html#os.path.normpath

Note Python docs explicitly specify that abspath() usually includes a transform that is equivalent to normpath.

Perhaps also note comment in Python docs that this "may change the meaning of a path that contains symbolic links".

…Actually, why is it .startswith() instead of ==, or even just .startswith('/')— or path.isabs()— anyway?