Make file module compatible with pathlib
Currently all operations (e.g. reading file) require that path is a string, which is a kind of python2 compatibility relict.
In the future it would be better if file module could accept pathlib.Path
as well.
Perhaps it would be sufficient to simply add:
path = str(path)
into calls which accept path.