In your second example you have a "\r" (carriage return) at the end of the file name.
In reply to Re: weird print output by jwkrahn in thread weird print output by yunfei