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.
This commit is contained in:
Tom Payerle 2024-02-28 16:00:51 -05:00 committed by GitHub
parent 17bfc41841
commit 935660e3d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -203,7 +203,7 @@ def _fix_dtrace_shebang(self, env):
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