All methods and functions that take a filename as argument should not only accept a string, but also a Path or path like object. Note that Path has been introduced with Python 3.4, so this might imply ...