This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients terry.reedy
Date 2008-08-07.22:36:49
SpamBayes Score 7.2165996e-05
Marked as misclassified No
Message-id <1218148611.21.0.579552262714.issue3521@psf.upfronthosting.co.za>
In-reply-to
Content
WinXP, 3.0b2
>>>f=open('somefile', 'r')
>>>f.readline(somefloat)
Traceback (most recent call last):
  File "<pyshell#70>", line 1, in <module>
    f.readline(1.0)
  File "C:\Program Files\Python30\lib\io.py", line 1766, in readline
    return line[:endpos]
TypeError: slice indices must be integers or None or have an __index__
method

At this point, any f.read or f.readline calls fail with a similar
TypeError.  The error recovery seems incomplete.  The same does *not*
happen with f.read(float).  Recovery is complete and subsequent
f.read/f.readline calls work.

In 2.5, float size arg worked with a deprecation warning, so issue does
not arise.  I presume same is true in 2.6.
History
Date User Action Args
2008-08-07 22:36:51terry.reedysetrecipients: + terry.reedy
2008-08-07 22:36:51terry.reedysetmessageid: <1218148611.21.0.579552262714.issue3521@psf.upfronthosting.co.za>
2008-08-07 22:36:49terry.reedylinkissue3521 messages
2008-08-07 22:36:49terry.reedycreate