From 935660e3d5d6e7448d6946c7ace98dac5a0fe533 Mon Sep 17 00:00:00 2001 From: Tom Payerle Date: Wed, 28 Feb 2024 16:00:51 -0500 Subject: mysql: explicity cast python command to str in _fix_dtrace_shebang() (#40781) This should fix issue #40780 We explicitly cast self.spec["python"].command to str in the filter_file call in _fix_dtrace_shebang to avoid the error ==> Error: TypeError: expected str, bytes or os.PathLike object, not Executable Not sure why the error is appearing (is it only for specific python versions, etc?), but the fix should be quite safe. --- var/spack/repos/builtin/packages/mysql/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/mysql/package.py b/var/spack/repos/builtin/packages/mysql/package.py index 49b79ec40c..36964dfa5a 100644 --- a/var/spack/repos/builtin/packages/mysql/package.py +++ b/var/spack/repos/builtin/packages/mysql/package.py @@ -203,7 +203,7 @@ class Mysql(CMakePackage): copy(dtrace, dtrace_copy) filter_file( "^#!/usr/bin/python", - "#!/usr/bin/env {0}".format(os.path.basename(self.spec["python"].command)), + "#!/usr/bin/env {0}".format(os.path.basename(str(self.spec["python"].command))), dtrace_copy, ) # To have our own copy of dtrace in PATH, we need to -- cgit v1.2.3-70-g09d2