From 7acc2c3a869f39ab67ab7e5c0c55380f656d7103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Thu, 9 Feb 2023 12:02:17 +0100 Subject: [PATCH] Ignore UnicodeDecodeError in shebang-fixing --- komodo/cli.py | 1 - komodo/shebang.py | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/komodo/cli.py b/komodo/cli.py index 8307c5392..c7af03ebb 100755 --- a/komodo/cli.py +++ b/komodo/cli.py @@ -141,7 +141,6 @@ def _main(args): # cases falling back to /tmp, which is undesired when building on nfs. os.environ["TMPDIR"] = args.tmp - print("Fixup #! in pip-provided packages if bin exist") release_path = Path(args.prefix) / Path(args.release) release_root = release_path / "root" for pkg, ver in args.pkgs.items(): diff --git a/komodo/shebang.py b/komodo/shebang.py index ef5180b60..e66e4fdc6 100644 --- a/komodo/shebang.py +++ b/komodo/shebang.py @@ -12,7 +12,7 @@ def fixup_python_shebangs(prefix, release): """Fix shebang to $PREFIX/bin/python. Some packages installed with pip do not respect target executable, that is, - they set as their shebang executable the Python executabl used to build the + they set as their shebang executable the Python executable used to build the komodo distribution with instead of the Python executable that komodo deploys. This breaks the application since the corresponding Python modules won't be picked up correctly. @@ -36,8 +36,9 @@ def fixup_python_shebangs(prefix, release): shebang = f.readline().strip() if _is_shebang(shebang): bins_.append(bin_) - except Exception as err: # pylint: disable=broad-except - print(f"Exception in reading bin {bin_}: {err}") + except UnicodeDecodeError: + # Whenever the executables are compiled binaries, we end here. + pass for bin_ in bins_: binpath_ = os.path.join(prefix, release, "root", "bin", bin_)