Skip to content
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

Catch stderr as well as stdout #2441

Merged
merged 1 commit into from Oct 1, 2013
Merged

Catch stderr as well as stdout #2441

merged 1 commit into from Oct 1, 2013

Conversation

torcolvin
Copy link
Contributor

We ignore if there is a bad return, and otherwise you have functional
code, but spurious and scary error reporting.

This happens for us on OS X, where you can have mismatched freetype loaded by system and from macports.

@@ -269,7 +269,7 @@ def get_fontconfig_fonts(fontext='ttf'):

fontfiles = {}
try:
pipe = subprocess.Popen(['fc-list', '', 'file'], stdout=subprocess.PIPE)
pipe = subprocess.Popen(['fc-list', '', 'file'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please consider wrapping this over multiple lines to conform with the PEP8 80 character limit.

@mdboom
Copy link
Member

mdboom commented Sep 20, 2013

For completeness' sake, can you provide the error message produced? I want to confirm it's innocuous before hiding it.

@torcolvin
Copy link
Contributor Author

dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /usr/X11/bin/fc-list
Reason: Incompatible library version: fc-list requires version 14.0.0 or later, but libfreetype.6.dylib provides version 10.0.0

This is something unique to our environment, because there is a version of libfreetype loaded from qt that is incompatible with a version in fc-list. This doesn't cause any problems with matplotlib fonts, since we fall back to font search from OSXInstalledFonts() because not every user has X11 installed with OS X anyway.

Moreover, we only show the error from fc-list, but no error from where it comes from in matplotlib, so the error message is disconnected and frightening.

@mdboom
Copy link
Member

mdboom commented Sep 30, 2013

@torcolvin: Would you mind rebasing this? It looks like a conflict has crept in in the meantime. Once that's done and Travis passes, I think this is good to merge.

@torcolvin
Copy link
Contributor Author

OK, I rebased.

mdboom added a commit that referenced this pull request Oct 1, 2013
Catch stderr as well as stdout
@mdboom mdboom merged commit 0b84819 into matplotlib:master Oct 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants