Re: [Tutor] pickle in unicode format

2005-04-07 Thread BRINER Cedric
On Tue, 2005-04-05 at 11:33 -0700, Danny Yoo wrote: > > > > I have this dictionnary : > > > > > > a={'partition': u'/export/diskH1/home_evol/ricquebo', > > > 'rsmFirstname': u'Fran\xe7ois', > > > 'rsmLastname': u'Ricquebourg', > > > 'size': u'8161222.0', > > > 'size_max': '1'} > > > > > > and

Re: [Tutor] pickle in unicode format

2005-04-05 Thread Danny Yoo
> Are you trying to send it off to someone else as a part of an XML > document? If you are including some byte string into an XML document, > you can encode those bytes as base64: > > ## > >>> bytes = 'Fran\xe7ois' > >>> encodedBytes = bytes.encode('base64') > >>> encodedBytes > 'RnJhbudvaXM=\

Re: [Tutor] pickle in unicode format

2005-04-05 Thread Danny Yoo
> > I have this dictionnary : > > > > a={'partition': u'/export/diskH1/home_evol/ricquebo', > > 'rsmFirstname': u'Fran\xe7ois', > > 'rsmLastname': u'Ricquebourg', > > 'size': u'8161222.0', > > 'size_max': '1'} > > > > and I'd like to *serialize* it with pickle and that the output format > > w

Re: [Tutor] pickle in unicode format

2005-04-05 Thread Kent Johnson
Kent Johnson wrote: BRINER Cedric wrote: unicode(pickle.dumps(a)) doesn't work ! pickle.dumps() doesn't return a value, it puts the data into 'a' which must be a file-like object. Oops, pickle.dumps() does return a value and the parameter is the object to be pickled. I even knew that before I se

Re: [Tutor] pickle in unicode format

2005-04-05 Thread Kent Johnson
BRINER Cedric wrote: hi, I have this dictionnary : a={'partition': u'/export/diskH1/home_evol/ricquebo', 'rsmFirstname': u'Fran\xe7ois', 'rsmLastname': u'Ricquebourg', 'size': u'8161222.0', 'size_max': '1'} and I'd like to *serialize* it with pickle and that the output format will be of type un

[Tutor] pickle in unicode format

2005-04-05 Thread BRINER Cedric
hi, I have this dictionnary : a={'partition': u'/export/diskH1/home_evol/ricquebo', 'rsmFirstname': u'Fran\xe7ois', 'rsmLastname': u'Ricquebourg', 'size': u'8161222.0', 'size_max': '1'} and I'd like to *serialize* it with pickle and that the output format will be of type unicode. unicode(pi