On Monday, June 27, 2016 at 1:40:35 PM UTC-5, Viktor Ransmayr wrote:

Leo 5.3 was working fine for me for quite some time.
>
> Without any (known) changes Leo stopped working :-(
>

Happily, I think we can say, the same thing just happened to me when I 
installed Python 3.5.2 on Anaconda 4.2.0 on my Win 10 laptop.  This was a 
pretty clean install: I uninstalled lots of old pythons first.
 
Rev 2e1137 works around this problem in an inelegant, but probably 
completely safe way.

Here are the relevant tracebacks
>

[Snip]

  File "C:\Users\Viktor\Programs\leo53\leo\core\leoGlobals.py", line 5910, 
in os_path_finalize
    path = os.path.abspath(path)
  File "C:\Python35\lib\ntpath.py", line 535, in abspath
    path = _getfullpathname(path)
ValueError: _getfullpathname: embedded null character

Googling the exact error message (ValueError: _getfullpathname: embedded 
null character) yielded this page 
<http://stackoverflow.com/questions/34004063/error-on-import-matplotlib-pyplot-on-anaconda3-for-windows-10-home-64-bit-pc>.
 


QQQ

This is a bug in python, not matplotlib. The issue is that winreg.EnumValue 
is not cutting string values at their length properly for some reason, and 
strings will include null characters which os.path.abspath is not able to 
process.

QQQ


It appears this bug has been around for a long time.  Otoh, it only bites 
on one of my Windows 10 machines. Pretty mysterious.

The fix is to strip null characters from paths in various places:

    path = path.replace('\x00','') # Fix Python 3 bug on Windows 10.

In an emergency, this kind of code can be applied right at the point of the 
crash, in this case, C:\Python35\lib\ntpath.py.

I am glad to be able to acknowledge this problem properly. It takes quite a 
bit of maintenance just to keep pace with *new* python bugs.

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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to