fix(types): get the os.PathLike type as correctly as possible by muggenhor · Pull Request #1227 · gitpython-developers/GitPython
Hmm. Does that mean you think it should accept bytes in some locations too?
I would refrain from doing anything that reduces convenience or being idiomatic or that is breaking just to gain correctness.
But I think that as it stands, GitPython will work fine until it doesn't because one tries to handle a path with characters that don't decode with the pre-configured default encoding. Right now this is UTF-8, certainly a decent choice. But it won't always work either.
To me the whole encoding topic in GitPython is a lost cause as correctness could (to my mind) only be achieved if the API doesn't use strings (with encoding) to handle them.
And by the looks of it, it's idiomatic to do that, too:
# py 3.8 >>> type(os.listdir('.')[0]) <class 'str'>
Edit: On the bright side, I believe just today I had an epiphany which helps me to see a future for GitPython, leveraging it as a strength and not seeing it as a burden. So I hope this will change my mindset too when helping to maintain it in the midterm until such a future can be realized.