Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

download_document fails on original document format docx #23

Open
maharg101 opened this issue Nov 16, 2020 · 0 comments
Open

download_document fails on original document format docx #23

maharg101 opened this issue Nov 16, 2020 · 0 comments

Comments

@maharg101
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant