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

UnicodeDecodeError: 'utf-8' codec can't decode byte... invalid continuation byte #475

Closed
Adam5i opened this issue Dec 31, 2019 · 1 comment
Labels

Comments

@Adam5i
Copy link

Adam5i commented Dec 31, 2019

I am using a search engine - pyserini (anserni) - which depends on pyjnius. Anserini is based on java and pyserini is using pyjnius to operate with anserini.
Returning the search hits, anserini holds them in a java object and when I tried to return the hit content (text) of one of the hits, I got the following error

Traceback (most recent call last):
  File "/my_directory/utils.py", line 26, in doc_content_from_hits
    return np.array(list(map(lambda result: hit, hits)))
  File "/my_directory/utils.py", line 26, in <lambda>
    return np.array(list(map(lambda hit: hit.content, hits)))
  File "jnius/jnius_export_class.pxi", line 336, in jnius.JavaField.__get__
  File "jnius/jnius_export_class.pxi", line 456, in jnius.JavaField.read_field
  File "jnius/jnius_conversion.pxi", line 155, in jnius.convert_jobject_to_python
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 46: invalid continuation byte

Other than that with that hit, it is working fine.
I'm using Python 3.7.3 on Debian, Java 8 and

Cython==0.29.14
pyserini==0.7.0.0
pyjnius==1.2.1

I saw two similar issues that existed before: #183 #285
Is there any way I can solve that issue on the pyjnius side?

@github-actions
Copy link

👋 We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.
Let us know if this comment was made in error, and we'll be happy to reopen the issue.

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

No branches or pull requests

2 participants