Pickling issue.

Vincent Vande Vyvre vincent.vande.vyvre at telenet.be
Mon Dec 21 05:11:53 EST 2020


Hi,

I've an object that I want to serialise with pickle.
When I reload the object the attributes of this object are correctly 
fixed except one of these.

This attribute (value) define a simple string.

Example:
---------------------------------------------
tag =  XmpTag('Xmp.dc.format', 'image/jpeg')
tag.key
'Xmp.dc.format'
tag.type
'MIMEType'
tag.value
'image/jpeg'

s = pickle.dumps(tag)
t = pickle.loads(s)
t.key
'Xmp.dc.format'     # Correct
t.type
'MIMEType'          # Correct
t.value
('image', 'jpeg')   # Not correct
---------------------------------------------

Tested with Python-3.8

An idea ?


More information about the Python-list mailing list