On Jan 25, 1:19 pm, Kent Tenney <[email protected]> wrote: > r 2758, opening my home file
[snip] > File "/home/ktenney/work/download/leo-editor/leo/core/leoAtFile.py", > line 619, in _contentHashFile > m.update(content) > UnicodeEncodeError: 'ascii' codec can't encode characters in position > 40156-40161: ordinal not in range(128) The complete fix is on the trunk at rev 2762. All unit tests pass "everywhere", that is, with Python 2.x/3.x on Window 7 and ubuntu. _contentHashFile calls the new g.internalError function if the contents part is a unicode string: contents must be a plain string (2.x) or bytes (3.x). This care is fully justified. I thank Ville for putting more rigor into this important code. Leo now caches things like window position and slider ratios using one of two keys, depending on Python version: leo3k.globals or leo2k.globals. This prevents clashes when switching back and forth between 2.x and 3.x code, as I do frequently. Finally, I changed several unit tests so that they work properly with both 2.x/3.x. In particular, unit tests must be careful not to call g.ue with a unicode string. As Ville has pointed out, we don't want g.ue to test for unicode, not because of performance considerations, but rather for the sake of rigor in the calling code. I believe we now have such rigor in the unit tests. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
