Skip to content

Py3fy font_manager. #10522

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

Merged
merged 1 commit into from
Mar 5, 2018
Merged

Py3fy font_manager. #10522

merged 1 commit into from
Mar 5, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 18, 2018

PR Summary

(orthogonal to #10435)

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added the Py3k label Feb 18, 2018
@anntzer anntzer added this to the v3.0 milestone Feb 18, 2018
@jkseppan
Copy link
Member

Looks correct to me. Did you test the changed code on Windows? The codecov output seems to indicate a lack of automated test coverage. On the other hand, a lot of the time the codecov results look just completely wrong.

@anntzer
Copy link
Contributor Author

anntzer commented Feb 18, 2018

Can't easily test on Windows right now, sorry.

stretch = 'semi-condensed'
elif fontname.find('wide') >= 0 or fontname.find('expanded') >= 0:
elif 'narrow' in fontname or 'cond' in fontname:
Copy link
Member

Choose a reason for hiding this comment

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

Why have these if statements swapped order?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the search for "demi cond" has to go before the search for "cond" (otherwise the latter always happens before the former...).

@@ -568,7 +544,7 @@ def createFontList(fontfiles, fontext='ttf'):
except UnicodeError:
_log.info("Cannot handle unicode filenames")
continue
except IOError:
except OSError:
_log.info("IO error - cannot open font file %s", fpath)
Copy link
Member

Choose a reason for hiding this comment

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

If its now an OSError should this message be changed, or is it obvious enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, from the POV of the user it is indeed an input/output error... (and IOError == OSError anyways on Py3)

@jklymak jklymak merged commit 0e89377 into matplotlib:master Mar 5, 2018
@anntzer anntzer deleted the py3fontmanager branch March 5, 2018 19:16
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.

4 participants