This must be a problem related to a a trailing \r
...
Try this:
'test1' + proj.rstrip() + 'test2'
Explanation:
Your concatenated string contains \r
in the middle. When printed, the console does print the beginning as test1...
but when it encounters the \r
, it "carriage-returns" to the beginning of the line, and overwrites it with the rest.