GNU bug report logs -
#29220
26.0.90; eieio-persistent-read fail to restore saved object.
Previous Next
Full log
Message #23 received at 29220 <at> debbugs.gnu.org (full text, mbox):
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> pierre.techoueyres <at> free.fr (Pierre Téchoueyres) writes:
>>
>>> So here is the same sample completed. Sorry.
>>>
>>> ;;; -*- lexical-binding: t -*-
>>> (require 'eieio)
>>> (require 'eieio-base)
>>>
>>> (defclass eieio-fail (eieio-persistent eieio-named)
>>> ((version :initarg :version :initform nil)
>>> (version-constant :allocation :class)
>>> (entries :initarg :entries :initform (make-hash-table))))
>>
>> This problem isn't related to my changes: it looks like the source of
>> the issue is the way the hash table is written, and the fact that one of
>> its entries holds an EIEIO object.
>>
>> As far as I can tell, when the hash table is written with `prin1', the
>> EIEIO object inside is also getting written with `prin1' instead of
>> `object-write'. The `prin1' representation isn't readable, so the
>> persistent read process chokes on it.
>>
>> The prin1 process for the hash table would have to detect that there's
>> an object in there, and write it with `object-write'.
>>
>> I assume this used to work? There have been several changes to the
>> printing process in Emacs 26, but I don't have a good grasp of the
>> details -- hopefully Stefan or someone will chime in.
>
> Stefan isn't subscribed to the bug list, so you have to Cc him (which
> I've now done). I note that adding (setq print-circle t) makes the
> given recipe work.
Unfortunately my receip is an incomplete subset of what pcache do with
the objects and hash tables. And even with `print-circle' set to t,
reading an pcache object still fail with emacs 26.
I've put an branch (pte/emacs-26) on github
(https://github.com/PierreTechoueyres/pcache.git) with some tests that
you can launch with
emacs-26 -batch -L . -l test/pcache-test.el -f ert-run-tests-batch-and-exit
Ask if I could provide more info.
Pierre
This bug report was last modified 6 years and 15 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.