[issue3521] file.readline: bad exception recovery

2009-04-24 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixed in r71855 -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python

[issue3521] file.readline: bad exception recovery

2009-04-22 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: -> benjamin.peterson nosy: +benjamin.peterson priority: -> high ___ Python tracker ___ __

[issue3521] file.readline: bad exception recovery

2009-02-07 Thread Daniel Diniz
Daniel Diniz added the comment: Maybe this one should be in 3.0.1? Benchmarking the isinstance approach against int() would be interesting. The io-c branch doesn't have this bug, so 3.1 is OK :) ___ Python tracker

[issue3521] file.readline: bad exception recovery

2008-08-27 Thread Daniel Diniz
Daniel Diniz <[EMAIL PROTECTED]> added the comment: Patch attached, suggested test below. def test_readline(): for mode in ('r', 'rb', 'r+', 'r+b'): f = open(__file__, mode) try: f.readline(0.1) except TypeError: tmp = f.readline() f.cl

[issue3521] file.readline: bad exception recovery

2008-08-07 Thread Guido van Rossum
Guido van Rossum <[EMAIL PROTECTED]> added the comment: Good catch! This looks pretty simple to fix; I think a type check is missing (actually several, there are at least two implementations in io.py). In fact, the 2.6 version of io.py already has the necessary checks. (But merging those forwa

[issue3521] file.readline: bad exception recovery

2008-08-07 Thread Terry J. Reedy
New submission from Terry J. Reedy <[EMAIL PROTECTED]>: WinXP, 3.0b2 >>>f=open('somefile', 'r') >>>f.readline(somefloat) Traceback (most recent call last): File "", line 1, in f.readline(1.0) File "C:\Program Files\Python30\lib\io.py", line 1766, in readline return line[:endpos] Type