My program was creating extra ‘-‘ characters, I spent ages looking in other parts of the code for the extra character creator.
The lesson “ Don’t make stupid mistakes inside ‘try:’ code
Like this one
try:
with open(self.fp_files[hd], 'r') as f: # fp_files loaded in setup
self.fastestplayers.append(f.read())
print('during opening', hd, self.fastestplayers(hd))
except:
self.fastestplayers.append('-')
The stupid thing was I forgot I had added the print command to follow the logic.
Hence I didn’t miss it!
Of course the () rather than [] in the superfluous print line created an error that triggered the exception code.
Hence the extra ‘-‘
Shared to help others look more carefully for stupid mistakes inside “try” code, after all you have told the interpreter you will handle errors in there!
...