import builtins
original_open = open

def bin_open(filename, mode='rb'):
    return original_open(filename, mode)
from PIL import Image
import pytesseract
img = Image.open('binarized_image.png')
UnicodeDecodeError with Tesseract OCR in Python