Fix for Issue-9413, removed use of 'with open' python 2.5+ feature