[Zope-dev] Re: StringIO and Zope

Tres Seaver tseaver at zope.com
Mon Jul 12 13:01:07 EDT 2004


Tor Oskar Wilhelmsen wrote:

> 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? Why?
 > Does anyone know???
> 
> 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!!!!

Does the problem go away if you change the import to:

   from StringIO import StringIO

 From the cStringIO library documentation 
(http://docs.python.org/lib/module-cStringIO.html):

> Unlike the memory files implemented by the StringIO module, those
 > provided by this module are not able to accept Unicode strings that
 > cannot be encoded as plain ASCII strings.


Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com



More information about the Zope-Dev mailing list