[issue7461] os.popen() objects don't support the context manager protocol

2009-12-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: I added a test for iterating and committed the patch in r76723 and r76724. Thanks! -- resolution: -> fixed status: open -> closed ___ Python tracker __

[issue7461] os.popen() objects don't support the context manager protocol

2009-12-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, iterating already works. Sorry for the noise. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue7461] os.popen() objects don't support the context manager protocol

2009-12-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: We should also proxy other special methods. There is __iter__, __next__, what else? -- ___ Python tracker ___ __

[issue7461] os.popen() objects don't support the context manager protocol

2009-12-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Here is a patch+test -- keywords: +patch nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file15504/with_popen.patch ___ Python tracker __

[issue7461] os.popen() objects don't support the context manager protocol

2009-12-08 Thread Antoine Pitrou
New submission from Antoine Pitrou : This works under trunk but fails under py3k: >>> import os >>> with os.popen("ls", "r") as f: ... print(f.read()) ... Traceback (most recent call last): File "", line 1, in AttributeError: __exit__ -- components: Library (Lib) messages: 96151 no