On Sun, May 31, 2020 at 10:04 AM vitalije <[email protected]> wrote:


> The *v.tnodeList *is assigned and deleted on several places in Leo code,
> but I can't find any place that it is actually used. I can't recall seeing
> this attribute ever, and I don't remember what its purpose used to be.
>

I don't either.

I assume that all those ancient attributes can be safely ignored. Am I
> missing something?
>

Thanks for spotting this. I don't think you are missing anything. If cff's
don't find anything, then there is nothing to find. Just make sure you
search plugins as well.

If I had to guess, my guess would be that tnode attributes were originally
used to handle marks and saved positions. They were probably saved in the
vnode associated with root at-file nodes, and become vestigial when we
started using an external cache for such things.

If those attributes can be ignored, I think Leo's reading and writing logic
> can be greatly simplified.
>

Good.


> Also there is a method FastRead.bytesToUnicode with the following __doc__:
>     """
>     Recursively convert bytes objects in strings / lists / dicts to str
>     objects, thanks to TNT
>     http://stackoverflow.com/questions/22840092
>     Needed for reading Python 2.7 pickles in Python 3.4.
>     """
>
> Leo is now running on Python 3.5 or newer. Do we still need to worry
> about this Python2.7 pickle compatibility?
>

The short answer is, I'm not sure. One can imagine a situation in which a
uA in an old .leo file might contain a 2.7 pickle. My guess that this
situation will be quite rare, now that Leo has required Python 3.6+ for
about a year.

I suggest the following. Let's assume that all pickles are "modern." That
is, I think it's ok for Leo to issue a message and fail to load a .leo file
if it contains an old pickle. In that case, maybe there could be a script
to do the conversion. But let's see if the problem ever happens.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS23qhN3_SdzkaEyD6v4Y%2B6bpzW6eNWKiyj6rMjPa5q%3D9w%40mail.gmail.com.

Reply via email to