[issue9940] Strange error reporting with "with" statement

2010-09-25 Thread Georg Brandl
Georg Brandl added the comment: At least not without losing generality, and we don't like that. -- nosy: +georg.brandl ___ Python tracker ___

[issue9940] Strange error reporting with "with" statement

2010-09-24 Thread Benjamin Peterson
Benjamin Peterson added the comment: I would say it's strange but correct. (and unavoidable I think) -- resolution: -> invalid status: open -> closed ___ Python tracker ___

[issue9940] Strange error reporting with "with" statement

2010-09-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Of course, you get the same error with: >>> f = open('foo', 'wb') >>> x, y = f Traceback (most recent call last): File "", line 1, in IOError: File not open for reading i.e. the tuple assignment iterates over the file, and calls readline() --

[issue9940] Strange error reporting with "with" statement

2010-09-24 Thread Antoine Pitrou
New submission from Antoine Pitrou : Under 3.2 and 3.1: >>> with open("foo", "wb") as x: pass ... >>> with open("foo", "wb") as (x, y): pass ... Traceback (most recent call last): File "", line 1, in io.UnsupportedOperation: read Similar oddities under 2.7: >>> with open("foo", "wb") as (