The 2-arg form of open strips leading and trailing spaces from the filename.
Except... for trailing whitespace: when the string ends in a null character ("\0") (optionally followed by more whitespace). The null character is stripped (or just ignored), but anything further inward, is left alone, including spaces.
At least, that's how I recall it (not tested today).
Nevertheless... thank goodness for 3 argument open, no?
p.s.AFAIK, there no equivalent trick for the front of the filename.