use "with"-statement in Python 2.5 (closes #5852)