Workaround for _getfullpathname:emedded null character appears: (Go from http://stackoverflow.com)
This was a bug in Python and not matplotlib.
winreg.EnumValue
The issue is-is isn't cutting string values at their length properly for some reason, and strings would include Nu ll characters which is isn't os.path.abspath
able to process.
The registry entry where this happens are at SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
. Despite this isn't being matplotlib ' s fault we can still temporarily patch it so it ends the string at ‘\0‘
. font_manager.py
in, Patch line 310 in the win32InstalledFonts()
function to:
key, direc, any = winreg.EnumValue( local, j)if not is_string_like(direc): continueif not os.path.dirname(direc): direc = os.path.join(directory, direc)direc = direc.split(‘\0‘, 1)[0]
Python-matplotlib Import Pyplot An error occurred in the resolution.