in reply to Re^2: "close" failing
in thread "close" failing

thanks a lot for the replies. You are right here. Because the print statements worked fine after the open call. (in "do processing" section). So, it cannot be that open has failed.