Description
The authentication file validation code introduced in 26.07.0 for #865 (see mmguero-dev@954daf7) introduced a multiline expression inside a single-quoted f-string:
missingAuthMessage = f'Files relating to authentication and/or secrets are missing: {", ".join([
p[len(malcolmPathPrefix) :] if p.startswith(malcolmPathPrefix) else p for p in missingAuthFiles
])}; please run ./scripts/auth_setup to generate them'
This syntax works with Python 3.12 and later due to the updated f-string grammar introduced by PEP 701.
On Python 3.11 and earlier, however, the script fails to parse with:
SyntaxError: unterminated string literal
This prevents commands such as start, wipe, and logs from running on systems using an older supported Python version.
Fix
Build the comma-separated file list separately, then interpolate the resulting string into the error message:
missingAuthFileList = ", ".join(
p[len(malcolmPathPrefix) :]
if p.startswith(malcolmPathPrefix)
else p
for p in missingAuthFiles
)
missingAuthMessage = (
"Files relating to authentication and/or secrets are missing: "
f"{missingAuthFileList}; please run ./scripts/auth_setup to generate them"
)
This preserves the existing behavior while remaining compatible with Python 3.11 and newer.
See idaholab@b1d0700 for the fix.
Description
The authentication file validation code introduced in 26.07.0 for #865 (see mmguero-dev@954daf7) introduced a multiline expression inside a single-quoted f-string:
This syntax works with Python 3.12 and later due to the updated f-string grammar introduced by PEP 701.
On Python 3.11 and earlier, however, the script fails to parse with:
This prevents commands such as
start,wipe, andlogsfrom running on systems using an older supported Python version.Fix
Build the comma-separated file list separately, then interpolate the resulting string into the error message:
This preserves the existing behavior while remaining compatible with Python 3.11 and newer.
See idaholab@b1d0700 for the fix.