Python beginner with an exception handling question.
August 16, 2007 12:55 PM
Subscribe
[PythonFilter] How does one handle specific errno of a built-in exception?
Both 'invalid path' and 'file does not exist' fall under IOError. How can I handle each case separately without resorting to custom exceptions?
posted by nilihm to computers & internet (10 comments total)
Strip off the directory and test if it exists first. Then, see if the file within it exists (by opening it).
posted by cmiller at 1:24 PM on August 16, 2007