betago icon indicating copy to clipboard operation
betago copied to clipboard

UnicodeDecodeError: 'gbk' codec can't decode... When running run_demo.py

Open BruceDai003 opened this issue 6 years ago • 2 comments

I didn't change anything and simply run the run_demo.py script. And I noticed that when running the Flask app served on localhost:8080, in the static_file_large(path), when the program is openning some *.png or *.jpg files, e.g. black.png, shadow.png, shinaya.jpg, with open("ui/large/" + path).read() statement, this error popped up, UnicodeDecodeError: 'gbk' codec can't decode byte 0x92 in position 30: illegal multibyte sequence. I think this open statement only works with those *.js files in the ui/large/ path, not working when reading picture files. Any workaround here?

I tried from PIL import Image and use Image.open() to load the images, but doesn't work.

BruceDai003 avatar Aug 29 '18 06:08 BruceDai003

same to me?how do U solve the problem?

xixiU avatar Apr 02 '19 01:04 xixiU

I met the same issue... did you resolve the problem?

Matt-Kou avatar Dec 12 '20 22:12 Matt-Kou