To further explain this consideration: even if both existence and
permissions were checked, the code would *still* be wrong if args[0]
were a directory.  If an .isdir() check were added, the code would
still be wrong if args[0] were a dangling symlink.  And so on.

Calling open() will detect all those potential problems.

Thank you for the commit.

But I think you should catch a exception which parser.readfp() throws,
and print approprite error mesage.

I think Users who don't know Python prefer an well-formatted
error message to stack trace.

Regards.

--
Masaru Tsuchiyama <m.tma...@gmail.com>

Reply via email to