Apologies that this has taken some time to post, I found the solution earlier today but was investigating other issues too. The patch is to add, on line 133:
user_attrs['surname'] = user_attrs['surname'].replace(r"'", r"\'")
Apologies that this has taken some time to post, I found the solution earlier today but was investigating other issues too. The patch is to add, on line 133:
user_attrs['surname'] = user_attrs['surname'].replace(r"'", r"\'")
Moving priority back to needs triage, I had caused a second fault during my investigation with a stray vim command. The above code alters the message to:
Ignore this post, I am keeping it here as it was a clue to the final solution: