kyamagu / fontconfig-py

Python bindings to fontconfig

Home Page:https://fontconfig-py.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error cannot load default config file

ValouBambou opened this issue · comments

Simply after installing in a venv I tried to open a shell and try import fontconfig and I get the following error:

Fontconfig error: Cannot load default config file: No such file: (null)

I'm on arch linux and using fontconfig version 2.14.2-1 if it helps.

Is this expected behavior ? It seems weird to get this log using a library for the first time.

Not sure. Probably this can be avoided by setting FONTCONFIG_PATH environment variable, but I don't know if there is anything the Python package can do to prevent it.

Maybe it could redirect the stderr when calling the external function that print this error and redirect the stderr when the call is done. Maybe the redirection to a string for error handling after, or simply to /dev/null to delete the message.

Just ignore the error message if it doesn't affect anything. Suppressing the underlying log by default is a bad practice in my opinion.