In Python 3 the regexp engine changed. The pattern .* matches both the zero-width 'thing' at the beginning of the line and the entire line. Because there were two matches your string was prepended twice.
Use either ^, which matches before the first character, or .+, which won't do a zero-width match.
|