Skip to content

Repeated warning about fc-list #5836

Closed
Closed
@astrofrog

Description

@astrofrog

Since Matplotlib 1.5.1, I see a warning (twice) each time I instantiate a FontManager():

In [2]: from matplotlib.font_manager import FontManager

In [3]: FontManager()
/Users/tom/miniconda3/envs/production/lib/python3.4/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
/Users/tom/miniconda3/envs/production/lib/python3.4/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
Out[3]: <matplotlib.font_manager.FontManager at 0x1057b6630>

In [4]: FontManager()
/Users/tom/miniconda3/envs/production/lib/python3.4/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
/Users/tom/miniconda3/envs/production/lib/python3.4/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
Out[4]: <matplotlib.font_manager.FontManager at 0x1064d4ba8>

This did not happen with 1.5.0. There's two issues here - the warning is repeated twice at each call, which indicates that the command is being run twice (inefficient), and the warning is being shown at all - why does fc-list need to be run every time FontManager is run? Even if there is a good reason for it to run, I'm not sure if a warning is necessary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions