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 #119

Closed
joarSv opened this issue Jun 3, 2014 · 6 comments
Closed

UnicodeDecodeError #119

joarSv opened this issue Jun 3, 2014 · 6 comments
Labels

Comments

@joarSv
Copy link

joarSv commented Jun 3, 2014

On line 468 in pysolr.py, the full_html needs to be decoded with utf-8 in order to handle the Swedish language.

Fix: full_html = full_html.decode('utf-8')

See comment in this commit: 2ea84356

@acdha
Copy link
Collaborator

acdha commented Aug 5, 2014

This appears to be the same as pull-request #123. Do you know if UTF-8 is the default for Jetty? I'm inclined to change the patch to only apply to the exception-handling path.

@stale
Copy link

stale bot commented Jun 5, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 5, 2018
@dennisrpnw
Copy link

dennisrpnw commented Jul 2, 2018

@acdha

File "/data/ckanuser/ckan/lib/default/src/ckan/ckan/lib/search/index.py", line 295, in index_package
    conn.add(docs=[pkg_dict], commit=commit)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pysolr.py", line 891, in add
    overwrite=overwrite, handler=handler)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pysolr.py", line 478, in _update
    return self._send_request('post', path, message, {'Content-type': 'text/xml; charset=utf-8'})
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pysolr.py", line 387, in _send_request
    solr_message = self._extract_error(resp)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pysolr.py", line 496, in _extract_error
    reason, full_html = self._scrape_response(resp.headers, resp.content)
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pysolr.py", line 527, in _scrape_response
    if response.startswith('<?xml'):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 202: ordinal not in range(128)

@stale stale bot removed the stale label Jul 2, 2018
@stale
Copy link

stale bot commented Sep 30, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 30, 2018
@oleksii-sl
Copy link

I'm getting same error as @dennisrpnw posted on python2.7

here is part of response variable (from sentry):

response | '<!doctype html><html lang="en"><head><title>HTTP Status 400 – Bad Request</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-fam'
-- | --

headers

headers | {'Date': 'Fri, 12 Oct 2018 13:38:50 GMT', 'Content-Length': '1306', 'Content-Type': 'text/html;charset=utf-8', 'Connection': 'close', 'Content-Language': 'en'}
-- | --

@stale stale bot removed the stale label Oct 12, 2018
@stale
Copy link

stale bot commented Jan 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 10, 2019
@stale stale bot closed this as completed Feb 9, 2019
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

4 participants