The check for file_contents didn't discriminate the argument missing and the file being empty

With a default argument ie file_contents = None

Checking if file_contents has been provided using:
    if file_contents:

... returns False for an empty file. This leads to very tedious debugging if your file happens to be empty!