Hi 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!!!! -Tor Oskar Wilhelmsen
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@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
No the problem is exactly the same with StringIO and cStringIO -Tow ----- Original Message ----- From: "Tres Seaver" <tseaver@zope.com> Newsgroups: gmane.comp.web.zope.devel To: "Tor Oskar Wilhelmsen" <toroskar@chello.no> Sent: Monday, July 12, 2004 7:01 PM Subject: Re: StringIO and Zope
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@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
[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.
Hi I can't print tracebacks. I'm unfortunatly on a windows system, an whats happen is tha Python jus quits, with no fault description. A type(data) gives me DbiRaw, which is the type of data in the DB -TOW ----- Original Message ----- From: "Tim Peters" <tim.peters@gmail.com> To: "Tor Oskar Wilhelmsen" <toroskar@chello.no> Cc: <zope-dev@zope.org> Sent: Monday, July 12, 2004 7:41 PM Subject: Re: [Zope-dev] StringIO and Zope
[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.
[Oskar Wilhelmsen]
I can't print tracebacks. I'm unfortunatly on a windows system, an whats happen is tha Python jus quits, with no fault description.
A type(data) gives me DbiRaw, which is the type of data in the DB
OK, can you break the line into two lines, as suggested before? Since you're getting no traceback info of any kind, it's impossible from what you've said so far to guess whether the problem is in StringIO or in DbiRaw's __str__ implementation. And since nobody else has said "ya, I see that too!", you're the only one who *can* supply additional info <wink>.
I wonder if there's any connection with http://sourceforge.net/tracker/index.php?func=detail&aid=983311&group_id=547... .
participants (4)
-
Simon Michael -
Tim Peters -
Tor Oskar Wilhelmsen -
Tres Seaver