betago
betago copied to clipboard
UnicodeDecodeError: 'gbk' codec can't decode... When running run_demo.py
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.
same to me?how do U solve the problem?
I met the same issue... did you resolve the problem?