How to Fix “TypeError: can’t use a string pattern on a bytes-like object in re.findall()” Error

In this article I am going to show you how to fix “TypeError: can’t use a string pattern on a bytes-like object in re.findall()” error. In my case, this error was caused by the following line of code: This code firstly encodes the string into bytes and subsequently tries to apply regular expression to it. […]
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x80 in position 3131: invalid start byte

When I was trying to read csv files in Python, I came across the UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x80 in position 3131: invalid start byte error. When I went up to the beginning of the error message, I saw a .DS_Store file and quickly realized the culprit. There was a hidden .DS_Store file […]