python core dump (SIGBUS) on Solaris

Tim O'Malley timo at bbn.com
Mon Jul 12 14:13:25 EDT 1999


hola.

Sorry for my delay in seeing this thread...

Andrew M. Kuchling writes:
 > Which is fine if loads() just chokes on bad input and raises an
 > exception, but not if it dumps core.  I don't see how to change this
 > behaviour in Cookie.py without breaking backward compatibility by
 > turning unpickling off by default,

The latest version of Cookie.py (Feb 23, 1999) contains a fix of sorts
to allow working around the problem with pickling.  This version of
Cookie.py has 3 different types of Cookie objects.  The first type will
never use pickles; the second type always uses pickles; and the third
type follows the old behavior:

class SimpleCookie(BaseCookie):
    """SimpleCookie
    SimpleCookie supports strings as cookie values.  When setting
    the value using the dictionary assignment notation, SimpleCookie
    calls the builtin str() to convert the value to a string.  Values
    received from HTTP are kept as strings.
    """

class SerialCookie(BaseCookie):
    """SerialCookie
    SerialCookie supports arbitrary objects as cookie values. All
    values are serialized (using cPickle) before being sent to the
    client.  All incoming values are assumed to be valid Pickle
    representations.  IF AN INCOMING VALUE IS NOT IN A VALID PICKLE
    FORMAT, THEN AN EXCEPTION WILL BE RAISED.
    """

class SmartCookie(BaseCookie):
    """SmartCookie
    SmartCookie supports arbitrary objects as cookie values.  If the
    object is a string, then it is quoted.  If the object is not a
    string, however, then SmartCookie will use cPickle to serialize
    the object into a string representation.
    """


In order to preserve backward compatibility:

  Cookie = SmartCookie        


		----------------------------------------
Does this adequately address the concerns?
  If not, I'm certainly open to other ideas...

-- 
.....................................................................
.   happy daze            .   Age and treachery will beat           .
.        -tim O           .       youth and skill every time.       .
.....................................................................




More information about the Python-list mailing list