This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients marc1nr, serhiy.storchaka
Date 2018-10-05.09:36:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538732216.08.0.545547206417.issue34894@psf.upfronthosting.co.za>
In-reply-to
Content
lxml.etree classes don't implement any methods related to pickling: __reduce__, __reduce_ex__, __getstate__, __setstate__, __getnewargs__, __getnewargs_ex__. But there are extension classes which contain the state invisible to Python. In this case they are pickled as empty classes that leads to unexpected error while unpickling. Python 3 detects such cases and raise exceptions while pickling. This change was not backported to 2.7 for compatibility reasons.

The only way to fix this issue in 2.7 is implementing pickle related methods (e.g. __getstate__ or __reduce__) in lxml.etree classes. They should either raise an exception, preventing pickling these objects, or implement support of pickling.
History
Date User Action Args
2018-10-05 09:36:56serhiy.storchakasetrecipients: + serhiy.storchaka, marc1nr
2018-10-05 09:36:56serhiy.storchakasetmessageid: <1538732216.08.0.545547206417.issue34894@psf.upfronthosting.co.za>
2018-10-05 09:36:56serhiy.storchakalinkissue34894 messages
2018-10-05 09:36:55serhiy.storchakacreate