-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Error loading fonts on OSX 10.11 #5386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Probably the same as #5314. I think your assessment isn't quite right though. There's something fishy here, but I don't think matplotlib catching a ValueError is the right thing to do. According to the docs, that should only be raised when invalid arguments are passed to I found other reports of similar bugs: this seems to be the new symptom for "file not found" on OSX 10.11, which is definitely broken behavior: ytdl-org/youtube-dl#6840 Also, for fun: https://i.imgur.com/To3DQ6J.jpg Does:
also give the same error? If so, definitely a bug that should be reported to CPython and/or Apple. |
That is an awesome cartoon! |
I found it on the Python bugtracker. https://bugs.python.org/issue18172 |
Further feedback from my 10.11 source:
|
Great. I'd say it's definitely a bug in Python 2.7.10 and/or an incompatiblity between how Apple builds Python 2.7.10 and El Capitain. I'd report this to CPython and/or Apple. I'd file the report myself, but since I don't have El Capitain to reproduce on, I'm afraid I won't be of much use. |
I can't reproduce it in any way using neither system python nor python 2.7 or 3.5 from homebrew on 10.11.1. Could it be fixed in the 10.11.1 update? |
@jenshnielsen - is it possible that you have |
Yes I have font-config installed. What I meant was that I can't reproduce the issue with a non existing command such as 'foo' with either python version i.e. running
raises a FileNotFoundError as expected. |
Ah - sorry for my confusion. My colleague also has 10.11.1. Can you think of any other explanation for the difference. |
Just a shot in the dark but could it be something like a non ascii username/path |
I don't think that's the case for my colleague's machine. We just upgraded a machine, and don't get the failure either. |
Nicholas Angelides is my colleague with this bug - we sat down with his computer for a few minutes. This expanded the confusion. We replicated the behavior above, both on his account and a new |
Hurrah, a Heisenbug! |
It appears python is assuming that a single read() call will read all available data (until EOF). That is not so. This should fix it:
|
That needs to be reported upstream, we are not going to ship a monkey patch to a core library. |
Yep, wasn't suggesting that... just giving people a workaround until it is resolved. |
Seems nobody has reported it to Python. Here it is: http://bugs.python.org/issue26083. |
A good workaround for matplotlib would be to use subprocess32 instead of subprocess when running on Python 2. It is better in too many ways to list here (and acts as a drop in replacement). The upstream issue has been fixed in 2.7. But I wouldn't expect Apple to fix anything in a timely manner. Pro tip: Build and install your own Python, never use the one shipped by your OS distro. |
I don't see the 2.7.12 release out yet . What is the best way to work around this issue to run matplotlib on El Capitan? |
I'm also having this issue, and my Python is installed through HomeBrew. Why not go with @gpshead advice instead of waiting for a fix from Python?
|
@acer9997 pull requests are always welcome. |
2.0 will require |
A colleague ran into the following error after installing a fresh copy of Matplotlib on OSX 10.11:
Not surprisingly, the problem turns out to be in
get_fontconfig_fonts
where the commandsubprocess.Popen(['fc-list', '--format=%{file}\\n'], ...)
returns aValueError
instead of the expectedOSError, IOError
and so the routine tries to load a pickle from the error message text and fails.fc-list
does not exist on my colleague's system.The text was updated successfully, but these errors were encountered: