diff --git a/news/545.update.rst b/news/545.update.rst new file mode 100644 index 00000000..ef2d92d3 --- /dev/null +++ b/news/545.update.rst @@ -0,0 +1,3 @@ +Add work-around for ``ffpyplayer`` 4.3.5 and 4.4.0 trying to use +``site.USER_BASE``, which is ``None`` in PyInstaller 5.5 and later +due to removal of PyInstaller's fake ``site`` module. diff --git a/src/_pyinstaller_hooks_contrib/hooks/rthooks.dat b/src/_pyinstaller_hooks_contrib/hooks/rthooks.dat index 66c614e5..bb92347f 100644 --- a/src/_pyinstaller_hooks_contrib/hooks/rthooks.dat +++ b/src/_pyinstaller_hooks_contrib/hooks/rthooks.dat @@ -1,5 +1,6 @@ { 'enchant': ['pyi_rth_enchant.py'], + 'ffpyplayer': ['pyi_rth_ffpyplayer.py'], 'osgeo': ['pyi_rth_osgeo.py'], 'traitlets': ['pyi_rth_traitlets.py'], 'usb': ['pyi_rth_usb.py'], diff --git a/src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_ffpyplayer.py b/src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_ffpyplayer.py new file mode 100644 index 00000000..01f96889 --- /dev/null +++ b/src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_ffpyplayer.py @@ -0,0 +1,19 @@ +#----------------------------------------------------------------------------- +# Copyright (c) 2023, PyInstaller Development Team. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# +# The full license is in the file COPYING.txt, distributed with this software. +# +# SPDX-License-Identifier: Apache-2.0 +#----------------------------------------------------------------------------- + +# Starting with v4.3.5, the `ffpyplayer` package attempts to use `site.USER_BASE` in path manipulation functions. +# As frozen application runs with disabled `site`, the value of this variable is `None`, and causes path manipulation +# functions to raise an error. As a work-around, we set `site.USER_BASE` to an empty string, which is also what the +# fake `site` module available in PyInstaller prior to v5.5 did. +import site + +if site.USER_BASE is None: + site.USER_BASE = ''