Closed anything4share closed 2 years ago
@qunosen Please offer more information, including runtime environment, translators version, python version, detail error message, etc.
@UlionTse I use code as follows on Windows 10 (python3.6, translators :https://github.com/UlionTse/translators, V4.9.5)
######################################## import translators as ts #### print(ts.baidu(‘apple’))
ERROR: ######################################## Exception in thread Thread-3: Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\threading.py", line 916, in _bootstrap_inner self.run() File "C:\ProgramData\Anaconda3\lib\threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1063, in _readerthread buffer.append(fh.read()) UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 76: illegal multibyte sequence
Traceback (most recent call last):
File "translators-master/test.py", line 11, in
Process finished with exit code 1
@qunosen print(translators.__version__)
@qunosen
print(translators.__version__)
v4.9.5 version
@qunosen attention UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 76: illegal multibyte sequence
, and remove threading
in your code.
@qunosen Mine, but run in Mac.
still same issue
表用百度翻译,出现索引错位的问题, 如,translators.baidu(‘apple’)