StringIO readline() bug??
fredrik at pythonware.com
fredrik at pythonware.com
Fri Oct 13 07:50:27 EDT 2000
More information about the Python-list mailing list
Fri Oct 13 07:50:27 EDT 2000
- Previous message (by thread): Problem installing the python-ldap mod
- Next message (by thread): StringIO readline() bug??
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Alex wrote: > Here's your error: StringIo needs to be initialized with > a string, not with a list of strings, which is what you're > giving it here. > > Use, instead: > > >>> fstr = StringIO(file.readline()) better make that: >>> fstr = StringIO(file.read()) > Note the difference: file.readline() returns the file's > contents as a single string; file.readlines() returns > it as a list of strings (one per line). readline() reads a single line, read() (without arguments) reads until end of file. </F> Sent via Deja.com http://www.deja.com/ Before you buy.
- Previous message (by thread): Problem installing the python-ldap mod
- Next message (by thread): StringIO readline() bug??
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list