diff --git a/fsl/utils/filetree/parse.py b/fsl/utils/filetree/parse.py
index f76fe9b7201f47ca3aa6607e0e2d0b6c91c6a68f..b2d6c883ab7dcc57c2c5ab8d8411c64e87470f26 100644
--- a/fsl/utils/filetree/parse.py
+++ b/fsl/utils/filetree/parse.py
@@ -50,7 +50,7 @@ def check_forbidden_characters(text, characters, text_type):
     """
     bad = [character for character in characters if character in text]
     if len(bad) > 0:
-        raise ValueError(f'Invalid character(s) "{"".join(bad)}" in {text_type}: {text}')
+        raise ValueError('Invalid character(s) "{}" in {}: {}'.format("".join(bad), text_type, text))
 
 
 def read_line(line: str) -> Tuple[int, PurePath, str]: