Make file.append int to string more pythonic

References: #12659