py: Fix str.replace for case when arg 0 or 1 is empty string.