tox-dev / filelock

A platform-independent file lock for Python.

Home Page:https://py-filelock.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The type annotation for the `lock_file` `__init__` parameter is too narrow

exarkun opened this issue · comments

BaseFileLock.__init__ annotates lock_file as str | os.PathLike[Any]. However, this excludes bytes which are still the basic representation of paths on most POSIX systems. The implementation goes on to pass lock_file to os.fspath which both accepts and may return bytes values so there doesn't seem to be any reason to exclude bytes from the annotation.

PR welcome 👍