OSError [Errno 22] invalid argument when use open() in Python

That is not a valid file path. You must either use a full path

open(r"C:\description_files\program_description.txt","r")

Or a relative path

open("program_description.txt","r")

Leave a Comment