<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18939"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT color=#000080 face=Garamond>I use codecs to retain consistent
unicode/utf-8 encoding and decoding for reading/writing to files. Should
the codecs be applied when using the pickle/unpickle function? For
example, the standard syntax is:</FONT></DIV>
<DIV><FONT color=#000080 face=Garamond></FONT> </DIV>
<DIV><FONT color=#000080 face=Garamond># pickle object</FONT></DIV>
<DIV><FONT color=#000080 face=Garamond>f = open(object,
'wb')<BR>pickle.dump(object, f, 2)<BR></FONT><FONT color=#000080
face=Garamond> </FONT></DIV>
<DIV><FONT color=#000080 face=Garamond># unpickle object<BR>f = open(object,
'rb')<BR>object= pickle.load(f)<BR> </FONT></DIV>
<DIV><FONT color=#000080 face=Garamond>or should it be:</FONT></DIV>
<DIV><FONT color=#000080 face=Garamond></FONT> </DIV>
<DIV><FONT color=#000080 face=Garamond>
<DIV><FONT color=#000080 face=Garamond># pickle object</FONT></DIV>
<DIV><FONT color=#000080 face=Garamond>f = codecs.open(object, 'wb',
'utf-8')<BR>pickle.dump(object, f, 2)<BR></FONT><FONT color=#000080
face=Garamond></FONT></DIV>
<DIV><FONT color=#000080 face=Garamond></FONT> </DIV>
<DIV><FONT color=#000080 face=Garamond># unpickle object<BR>f =
codecs.open(object, 'rb', 'utf-8')<BR>object= pickle.load(f)<BR></FONT></DIV>
<DIV><FONT color=#000080
face=Garamond> </DIV></FONT></DIV></FONT></BODY></HTML>