[Python-bugs-list] [ python-Bugs-671447 ] StringIO doc doesn't say it's sometimes read-only

SourceForge.net noreply@sourceforge.net
Tue, 21 Jan 2003 12:24:36 -0800


Bugs item #671447, was opened at 2003-01-21 00:58
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=671447&group_id=5470

Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Mike Orr (hierro)
Assigned to: Nobody/Anonymous (nobody)
Summary: StringIO doc doesn't say it's sometimes read-only

Initial Comment:
When StringIO is instantiated with an intial string:
StringIO("Hello, world!")
it's read-only; the write methods don't exist.  The
Python Library Reference should mention this.

If you instantiate StringIO without an initial string:
StringIO()
you get both read and write methods.

----------------------------------------------------------------------

Comment By: Christos Georgiou (tzot)
Date: 2003-01-21 22:24

Message:
Logged In: YES 
user_id=539787

Did you import StringIO, or cStringIO as StringIO ?

This behaviour occurs only in cStringIO... if you do

m= cStringIO.StringIO("hello there")
n= cStringIO.StringIO()

you see that type(m) is cStringIO.StringI and n is 
cStringIO.StringO.

This is documented in the cStringIO module documentation.

 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=671447&group_id=5470