Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def parse(filename, encoding=None, default_extension=""):
if not os.path.isfile(filename):
raise IOError(errno.ENOENT, "File not found", filename)
return ParsedFile(filename, encoding=encoding, default_extension=default_extension)