gawel / pyquery

A jquery-like library for python
http://pyquery.rtfd.org/
Other
2.29k stars 182 forks source link

Openfile without encoding set will cause UnicodeDecodeError #197

Closed kervinct closed 6 years ago

kervinct commented 6 years ago

When I attempting to use a file with PyQuery, the code raised UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 755: illegal multibyte sequence

So I changed file pyquery.py 216 line code to html = open(kwargs['filename'], encoding='utf-8')and the code runs well.

Is that solution is wrong?