When downloading a pre-translated document using is_xliff="false" the download_document attempts to decode the api response as UTF-8, which results in a UnicodeDecodeError.
To reproduce, upload a docx file for pretranslation. Once processed, download:
api_instance.download_document(job_id, is_xliff="false")
Observe the following error:
File "/path/to/src/lilt-pipeline-wrapper/venv/lib/python3.7/site-packages/lilt/api_client.py", line 205, in __call_api
response_data.data = response_data.data.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 10: invalid continuation byte
I found mention of a bytes response type at
|
if six.PY3 and response_type not in ["file", "bytes"]: |
but it is not clear if / how this may be used.
When downloading a pre-translated document using
is_xliff="false"the download_document attempts to decode the api response as UTF-8, which results in a UnicodeDecodeError.To reproduce, upload a docx file for pretranslation. Once processed, download:
Observe the following error:
I found mention of a
bytesresponse type atlilt-python/lilt/api_client.py
Line 200 in 364b633