call #to_s on file path in case a Pathname object is given