How to fix TypeError: argument should be a str object or an os.PathLike object, not type in Python | DevErrors