Éric Araujo <mer...@netwok.org> added the comment: To clarify: Python 2.5 and higher support the with statement syntax, but not all classes that could benefit from it have the __enter__ and __exit__ methods. So you don’t get a SyntaxError in Python 2.7 when you write “with Popen(...)”, but you get an AttributeError because Popen in 2.7 does not do its part to support context management. The built-in open function, on the contrary, supports with in 2.5 and higher.
---------- resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13202> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com