A quick test: >>> try: f = open("foo","r") except IOError, error: print errno.errorcode[error.errno]
ENOENT It looks to me like your if statement should be as simple as: if error.errno == errno.ENOENT: print os.strerror(error.errno) Mark -- http://mail.python.org/mailman/listinfo/python-list