From c1752a0695b43eb5d0b05617685f02d9133e9bb1 Mon Sep 17 00:00:00 2001 From: Aleh Zasypkin Date: Sun, 22 Mar 2026 13:09:51 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20fontconfigs=20=E2=86=92=20fontconfig=20pa?= =?UTF-8?q?th=20in=20pythonlib/utils.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for the great project! === The browser bundle renamed the `fontconfigs` directory to `fontconfig` in https://github.com/daijro/camoufox/pull/519, but `pythonlib/camoufox/utils.py` still references the old `fontconfigs` path. This causes a `FileNotFoundError` at runtime when launching with OS fingerprint spoofing: ``` FileNotFoundError: fonts.conf not found in /root/.cache/camoufox/browsers/official/146.0.1-alpha.25/fontconfigs/windows! ``` This PR updates the path reference in `utils.py` to match the new directory name. --- pythonlib/camoufox/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonlib/camoufox/utils.py b/pythonlib/camoufox/utils.py index 02775168..3f81c7e4 100644 --- a/pythonlib/camoufox/utils.py +++ b/pythonlib/camoufox/utils.py @@ -70,14 +70,14 @@ def get_env_vars( if OS_NAME == 'lin': # https://github.com/coryking/camoufox/commit/f21eeb2850a74cc104fb57e17e0a2fa27b7a2a28 # Thanks @coryking - # the user_agent_os is either 'lin', 'mac', or 'win' but our fontconfigs directory is 'linux', 'macos', or 'windows' + # the user_agent_os is either 'lin', 'mac', or 'win' but our fontconfig directory is 'linux', 'macos', or 'windows' directory_map = { 'lin': 'linux', 'mac': 'macos', 'win': 'windows', } os_dir = directory_map.get(user_agent_os, user_agent_os) - fontconfig_path = get_path(os.path.join("fontconfigs", os_dir)) + fontconfig_path = get_path(os.path.join("fontconfig", os_dir)) # assert that fonts.conf exists in the directory if not os.path.exists(os.path.join(fontconfig_path, "fonts.conf")):