Fixed "re.sub can not use a string pattern on a bytes-like object" bug