[Zope-dev] StringIO and Zope

Tim Peters tim.peters at gmail.com
Mon Jul 12 13:41:33 EDT 2004


[Oskar Wilhelmsen]
> I have a problem with python 2.3.3 and Zope 2.7.0. When I Execute the code
> below, Python just get som unhandled exceptions, and crash?

What are (exactly) the "unhandled exceptions"?  Can you paste in tracebacks?

> from cStringIO import StringIO
> #pic[3] is a blob in a database
> data = pic[3]
>                 
> fil = StringIO(str(data)) #this line makes Zope and Python crash!!!!

Since you later said it didn't matter whether you used StringIO or
cStringIO, it would be helpful to beak that into two lines:

temp = str(data)
fil = StringIO(temp)

Might also help to print type(data).  Since str() and StringIO() are
so heavily used, it's unlikely the problem is in either of them.  Most
likely is a problem in type(data)'s __str__ or __repr__
implementations.


More information about the Zope-Dev mailing list